Re: ALTER TABLE ... ALTER CONSTRAINT

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: ALTER TABLE ... ALTER CONSTRAINT
Дата
Msg-id 20130609125017.GB24178@alap2.anarazel.de
обсуждение исходный текст
Ответ на ALTER TABLE ... ALTER CONSTRAINT  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: ALTER TABLE ... ALTER CONSTRAINT  (Kevin Grittner <kgrittn@ymail.com>)
Re: ALTER TABLE ... ALTER CONSTRAINT  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Список pgsql-hackers
On 2013-06-08 21:45:24 +0100, Simon Riggs wrote:
> While fiddling with FK tuning, it was useful to be able to enable and
> disable the DEFERRED mode of constraints.
> 
> That is not currently possible in SQL, so I wrote this patch. Without
> this you have to drop and then re-add a constraint, which is
> impractical for large tables.
> 
> e.g.
> CREATE TABLE fktable (id integer, fk integer REFERENCES pktable (id));
> 
> ALTER TABLE foo
>    ALTER CONSTRAINT fktable_fk_fkey DEFERRED INITIALLY IMMEDIATE;
> 
> Includes docs and tests.
> 
> Currently works for FKs only. Potentially other constraints can be
> supported in future.

I haven't looked at the patch in detail, but I am very, very much in
favor of the feature in general… I have wished for this more than once,
and it certainly cost me more time working around it than it would have
cost to implement it.

Thanks,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Optimising Foreign Key checks
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Hard limit on WAL space used (because PANIC sucks)