I would like to be able to truncate all of the tables in a schema without worrying 
about FK constraints. I tried issuing a "SET CONSTRAINTS ALL DEFERRED" before 
truncating, but I still get constraint errors. Is there a way to do something like:

1) disable all constraints
2) truncate all tables
3) re-enable all constraints

?

In the slony project there is a procedure "altertableforreplication" that appears to 
do 1), but since it is updating pg_catalog tables directly, I don't want to cut/paste 
before I understand what it's doing!

Is there any "standard" way of doing this?

- DAP
----------------------------------------------------------------------------------
David Parker    Tazz Networks    (401) 709-5130
 

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to