Thread: How move a referenced table between schemas?

How move a referenced table between schemas?

From
Andreas
Date:
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. ;)




Re: How move a referenced table between schemas?

From
Tom Lane
Date:
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