On Sat, Nov 6, 2010 at 6:09 PM, Robert Haas <robertmh...@gmail.com> wrote: > Since we now have PL/pgsql by default, we could possibly fix pg_dump > --clean by emitting a DO block, although the syntax for checking > existence of a table is none too pretty, and it would make pg_dump > --clean rely for correctness on plpgsql being installed, which might > be none too desirable. It would actually be sort of spiffy to be able > to have some of the PL/pgsql control constructs available in straight > SQL, but I'm not expecting that to happen any time in the forseeable > future.
I have hacked up a little set of work-in-progress pg_dump patches as a proof of concept. It uses the PGSQL and DO mechanics, thanks for making me aware of the latter... https://github.com/fdr/postgres/tree/pg_dump-if-exists I will be giving it a try on some more schemas in the near future. On my small, plain but not-entirely-a-toy schema it works great. For some reason I cannot seem to get it to exercise the ALTER DOMAIN check, even though I created a domain with a check constraint...hmm, I'll have to stare at what can cause it to exercise that later. fdr -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers