Thread: Regenerating references

Regenerating references

From
"SZŰCS Gábor"
Date:
Hi there,

As always, feel free to show me to the archives if this question is already
answered.

We seek the simplest way to regenerate references on a
dropped-and-regenerated table.

1. Drop all referencing tables. This may cause recursion so we don't like
the idea.

2. Find out all the references to the table before dropping it, then create
the RI triggers as found in the output of pg_dump, for all the referencing
tables and the dropped table.
   I'm not sure if it's enough, but I think we can generate the appropriate
trigger commands. Is there a clearly separable algorithm to do this, say, a
function in pg_dump's source?

3. Any other ideas?

Thanks in advance,
G.
--
while (!asleep()) sheep++;

---------------------------- cut here ------------------------------