I’m in psql trying to create a table for a python admin. It’s actually an extension of a working admin, so I’m adding a new table and some relations. When I enter in the following sequence, it never executes to completion:
BEGIN;
CREATE TABLE "work_projectinteractiveasset" (
"id" serial NOT NULL PRIMARY KEY,
"name" varchar(200) NOT NULL,
"image" varchar(100) NOT NULL,
"project_id" integer NOT NULL REFERENCES "work_project" ("id") DEFERRABLE INITIALLY DEFERRED
);
CREATE INDEX "work_projectinteractiveasset_project_id"
ON "work_projectinteractiveasset" ("project_id");
COMMIT;
The prompt ends with
NOTICE: CREATE TABLE will create implicit sequence “work_projectinteractiveasset_id_seq” for serial column “work_projectinteractiveasset.id”
But it just stays there until I ctrl-c out of it. Is there some way to force the completion?
I am not actually able to produce this error. However what it sounds like is you have a lock that is stopping the work from completing.
postgres=# select version();
version
PostgreSQL 8.3.8 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu 4.4.1-3ubuntu3) 4.4.1
(1 row)