How move a referenced table between schemas?

Started by Andreasalmost 17 years ago2 messagesgeneral
Jump to latest
#1Andreas
maps.on@gmx.net

Hi,
how can I move a table from one schema to another even though it is
referenced by foreign keys?

Cloning the table and the manually recreating every reference shouldn't
be the only way, or is it? :(

How can I dump/export every reference on a table?
Until now I call DROP TABLE and look in the error message for the
referencing tables. There must be a more elegant way, I hope. ;)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andreas (#1)
Re: How move a referenced table between schemas?

Andreas <maps.on@gmx.net> writes:

how can I move a table from one schema to another even though it is
referenced by foreign keys?

ALTER TABLE SET SCHEMA. The foreign keys don't care (at least not
in any remotely modern PG release).

regards, tom lane