Re: ToDo: conditional ALTER TABLE

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: ToDo: conditional ALTER TABLE
Дата
Msg-id 20111220033745.GB26050@tornado.leadboat.com
обсуждение исходный текст
Ответ на ToDo: conditional ALTER TABLE  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On Mon, Dec 19, 2011 at 10:25:34AM +0100, Pavel Stehule wrote:
> I am working on quiet dumps now. i found a small issue.
> 
> pg_dump produces a statements
> 
> ALTER TABLE ONLY public.b DROP CONSTRAINT b_fk_fkey;
> ALTER TABLE ONLY public.a DROP CONSTRAINT a_pkey;
> 
> DROP TABLE IF EXISTS public.b;
> DROP TABLE IF EXISTS public.a;
> 
> Actually there is no a conditional ALTER. These statements must be
> before DROPs, but then it can fails when these tables are missing.
> 
> So some form like ALTER TABLE IF EXISTS ... should be usefull

If ALTER TABLE is the only ALTER command you'd need to change this way, I think
your proposal is good.

nm (who has never used "pg_dump --clean")


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: ALTER TABLE lock strength reduction patch is unsafe
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ALTER TABLE lock strength reduction patch is unsafe