最近我在尝试使用Djang与Django时遇到了麻烦.我用这种方式安装了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)
Run Code Online (Sandbox Code Playgroud)
并天真地认为我的新数据库将包括hstore.情况并非如此:
$ createdb dbtest …Run Code Online (Sandbox Code Playgroud) 我已成功安装了hstore扩展,一切都可以正常工作syncdb.(我正在使用djorm-ext-hstore)
但是,nose会创建一个新的临时数据库来运行测试,并且没有安装hstore.
我需要CREATE EXTENSION HSTORE;在鼻子同步数据库之前运行测试数据库,但我找不到有关如何执行此操作的任何信息.
有任何想法吗?