Re: altering foreign key without a table scan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vincent de Phily <vincent(dot)dephily(at)mobile-devices(dot)fr>
Cc: Jerry Sievers <gsievers19(at)comcast(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: altering foreign key without a table scan
Date: 2011-08-19 15:52:50
Message-ID: 8800.1313769170@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Vincent de Phily <vincent(dot)dephily(at)mobile-devices(dot)fr> writes:
> On Thursday 18 August 2011 13:08:18 Jerry Sievers wrote:
>> Your 2 catalog fields of interest are;
>> pg_constraint.(confupdtype|confdeltype)
>>
>> Changing those for the relevant FKs should satisfy your needs. I am
>> not aware of those field values being duplicated anywhere.

> Thanks for your answer. Experimenting a bit, those columns seem to have only a
> cosmetic impact, meaning that "\d" will show the schema you expect, but the
> behaviour remains unchanged (even after restarting postgres).

> Digging further however, I found that pg_triggers can be used for my means :

IIRC, there are fields of pg_constraint that are copied into the
pg_trigger rows for the supporting triggers, so as to save one catalog
lookup at run time. If you diddle one manually, you'd better diddle
both.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Travers 2011-08-19 15:53:36 Re: Need linux uid in pg-psql
Previous Message dexdyne 2011-08-19 15:41:10 date_trunc - not sure what is wrong, but it confuses me.