Обсуждение: change conndeferrable in pg_constraint?

Поиск
Список
Период
Сортировка

change conndeferrable in pg_constraint?

От
"mboscia"
Дата:
I have a situation where I need to set my constraints and keys
deferrable.  Is it safe to update the condeferrable flag in
pg_constraint to true to make this happen?  The alternative is to drop
all the constraints and add them back as deferrable.

Michael L. Boscia
mbrngrboy@cox.net


Re: change conndeferrable in pg_constraint?

От
"mboscia"
Дата:
 charset="ISO-8859-1";
    charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3

What I Did.

I updated the pg_constraint table and set the condeferrable column to
't' where the contype was 'f' for foriegn key.  I also updated the
pg_trigger table and set tgdeferrable to 't' where tgisconstraint  was
't'.

The transaction that I was trying to defer worked perfectly.  I also did
a pg_dump and noticed that the definition of the constraints now
contained the keyword deferrable.

I am still not sure if this is an accepted method.
---

I have a situation where I need to set my constraints and keys
deferrable.  Is it safe to update the condeferrable flag in
pg_constraint to true to make this happen?  The alternative is to drop
all the constraints and add them back as deferrable.
Michael L. Boscia
mbrngrboy@cox.net