ALTER TABLE ... ALTER CONSTRAINT

Поиск
Список
Период
Сортировка
Искать
От
Simon Riggs
Тема
ALTER TABLE ... ALTER CONSTRAINT
Дата
Msg-id
CA+U5nML4d_HJfp2+hcbYQcGA_Y30nxt+Yu-44KVtQgcSJB09+w@mail.gmail.com
Список
Дерево обсуждения
ALTER TABLE ... ALTER CONSTRAINT Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE ... ALTER CONSTRAINT Andres Freund <andres@2ndquadrant.com>
Re: ALTER TABLE ... ALTER CONSTRAINT Kevin Grittner <kgrittn@ymail.com>
Re: ALTER TABLE ... ALTER CONSTRAINT Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Re: ALTER TABLE ... ALTER CONSTRAINT Michael Paquier <michael.paquier@gmail.com>
Re: ALTER TABLE ... ALTER CONSTRAINT Abhijit Menon-Sen <ams@2ndQuadrant.com>
Re: ALTER TABLE ... ALTER CONSTRAINT Jeff Janes <jeff.janes@gmail.com>
Re: ALTER TABLE ... ALTER CONSTRAINT Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE ... ALTER CONSTRAINT Simon Riggs <simon@2ndQuadrant.com>
Re: ALTER TABLE ... ALTER CONSTRAINT Alvaro Herrera <alvherre@2ndquadrant.com>
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.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления
От: Jeff Janes
Дата:
От: Greg Smith
Дата:
FAQ