【发布时间】:2012-07-20 01:10:28
【问题描述】:
最近I went into trouble 尝试在 Django 中使用 hstore。我是这样安装 hstore 的:
$ sudo -u postgres psql
postgres=# CREATE EXTENSION hstore;
WARNING: => is deprecated as an operator name
DETAIL: This name may be disallowed altogether in future versions of PostgreSQL.
CREATE EXTENSION
postgres=# \dx
List of installed extensions
Name | Version | Schema | Description
---------+---------+------------+--------------------------------------------------
hstore | 1.0 | public | data type for storing sets of (key, value) pairs
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(2 rows)
天真地以为我的新数据库将包括 hstore。不是这样的:
$ createdb dbtest
$ psql -d dbtest -c '\dx'
List of installed extensions
Name | Version | Schema | Description
---------+---------+------------+------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(1 row)
有没有办法在新创建的数据库中自动拥有 hstore ?
【问题讨论】:
标签: sql postgresql postgresql-9.1 hstore