Re: ALTER TABLE ... IF EXISTS feature?
От | Daniel Farina |
---|---|
Тема | Re: ALTER TABLE ... IF EXISTS feature? |
Дата | |
Msg-id | AANLkTik5jS0cozYKzisZYW1NkxvQXuO7SxraKiqi9g8p@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: ALTER TABLE ... IF EXISTS feature? (Daniel Farina <drfarina@acm.org>) |
Список | pgsql-hackers |
On Sat, Nov 6, 2010 at 6:09 PM, Robert Haas <robertmhaas@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
В списке pgsql-hackers по дате отправления: