wiz scroll django primary_fkey manage py sqlreset test1 psql -h 127 -U

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
wiz@scroll:~/django/primary_fkey$ ./manage.py sqlreset test1|psql -h 127.0.0.1 -U test -e
Password for user test:
BEGIN;
BEGIN
DROP TABLE "test1_bar";
NOTICE: constraint test2_baz_bar_id_fkey on table test2_baz depends on table test1_bar
ERROR: cannot drop table test1_bar because other objects depend on it
HINT: Use DROP ... CASCADE to drop the dependent objects too.
DROP TABLE "test1_foo";
ERROR: current transaction is aborted, commands ignored until end of transaction block
CREATE TABLE "test1_foo" (
"id" serial NOT NULL PRIMARY KEY,
"spam" boolean NOT NULL
)
;
ERROR: current transaction is aborted, commands ignored until end of transaction block
CREATE TABLE "test1_bar" (
"id" integer NOT NULL PRIMARY KEY REFERENCES "test1_foo" ("id") DEFERRABLE INITIALLY DEFERRED,
"eggs" boolean NOT NULL
)
;
ERROR: current transaction is aborted, commands ignored until end of transaction block
COMMIT;
ROLLBACK