我正在尝试在 postgres 中创建一个新表,但是当我这样做时,它只是在CREATE TABLE
通话后挂起。
$ sudo usermod -s /bin/bash postgres
$ sudo su - postgres
postgres@host:~$ psql ranking_analytics
psql (8.4.8)
Type "help" for help.
ranking_analytics=# BEGIN;
BEGIN
ranking_analytics=# CREATE TABLE "about_contactmessage" (
ranking_analytics(# "id" serial NOT NULL PRIMARY KEY,
ranking_analytics(# "user_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
ranking_analytics(# "subject" text NOT NULL,
ranking_analytics(# "message" text NOT NULL,
ranking_analytics(# "recorded_time" timestamp with time zone NOT NULL
ranking_analytics(# )
ranking_analytics-# ;
NOTICE: CREATE TABLE will create implicit sequence "about_contactmessage_id_seq" for serial column "about_contactmessage.id"
然后它会无限期地坐在这里直到我CTRL-C
它。
数据库中还有其他表,但此表尚不存在:
ranking_analytics=# \d about_contactmessage
Did not find any relation named "about_contactmessage".
我可以毫无问题地对数据库中的其他表进行插入和删除查询:
ranking_analytics=# insert into locations_continent (continent_name) VALUES ('testing');
INSERT 0 1
ranking_analytics=# delete from locations_continent where continent_name = 'testing';
DELETE 1
机器上有足够的驱动器空间:
$ df -H
Filesystem Size Used Avail Use% Mounted on
/dev/xvda 21G 2.3G 18G 12% /
devtmpfs 255M 132k 255M 1% /dev
none 257M 476k 256M 1% /dev/shm
none 257M 54k 257M 1% /var/run
none 257M 0 257M 0% /var/lock
有什么想法可能是错的吗?