Re: to suspend constraints
От | Stephan Szabo |
---|---|
Тема | Re: to suspend constraints |
Дата | |
Msg-id | 20030326215126.O70893-100000@megazone23.bigpanda.com обсуждение исходный текст |
Ответ на | to suspend constraints ("Jowisz" <jowisz@USUNTO.rozanka.wroc.pl>) |
Список | pgsql-general |
On Wed, 26 Mar 2003, Jowisz wrote: > Does anyone knows, is there any possibility to turn off temporarily (to > suspend) constraints checking? I couldn't find this in docs. Or maybe there > isn't way to do things like this... Not in any easy user-accessable way that I know of (apart from dropping a constraint and re-adding it). If you're willing to go through some moderately painful changing of system tables, you can stop foreign keys (and all user defined triggers) by setting reltriggers to 0 in pg_class, but you have to be careful to set it back to the correct value. You can (at least in current sources) do something similar for check constraints with relchecks AFAICS. NOT NULL can be controlled with attnotnull in the pg_attribute row for the particular attribute. I don't know of a reasonable way to turn off unique (flipping indisunique in the pg_index row seems to not take effect immediately if the index has been used in your session, and I'm really not sure it's safe in any case).
В списке pgsql-general по дате отправления: