Please find the patch attached. This is for the bug which is posted to
We can see a problem by this bug in following way.
CREATE TABLE pktable (a int primary key);
CREATE TABLE fktable (b int references pktable);
ALTER TABLE pktable ALTER COLUMN a TYPE bigint; -- succeed
REINDEX TABLE pg_depend;
ALTER TABLE pktable ALTER COLUMN a TYPE int; -- fail
NOTICE: constraint fktable_b_fkey on table fktable depends on index
ERROR: cannot drop constraint pktable_pkey on table pktable because
other objects depend on it
HINT: Use DROP ... CASCADE to drop the dependent objects too.
I changed the order of constraints list to delete foreign key
Any comments are welcome.
pgsql-patches by date
|Next:||From: Tom Lane||Date: 2006-01-27 15:09:00|
|Subject: Re: Adding a --quiet option to initdb |
|Previous:||From: Junji TERAMOTO||Date: 2006-01-27 10:38:37|
|Subject: BTree vacuum before page splitting|