Re: BUG #3424: Not able to drop trigger(RI_trigger*) on specific table. - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #3424: Not able to drop trigger(RI_trigger*) on specific table.
Date
Msg-id 468A0DA5.4020801@enterprisedb.com
Whole thread Raw
In response to BUG #3424: Not able to drop trigger(RI_trigger*) on specific table.  ("S R Madhu" <sraj_madhusr@yahoo.com>)
List pgsql-bugs
S R Madhu wrote:
> We have created a table "student".
> Foreign key and triggers are created in student. We are able to map triggers
> and constraints from pg_class table.
>
> We have used following mapping mechanism to get the trigger name.
> pg_class.relfilenode -> pg_trigger.tgrelid.
>
> We have used following mapping mechanism to get the constraint name.
> pg_class.relfilenode -> pg_constraint.conrelid.
>
> Problem : After ALTER TABLE command to this table, We are not able to map
> triggers/constraints and tables.
> relfilenode in pg_class is changed after ALTER TABLE.
> but this is not reflected in pg_constraint/pg_triggers.

pg_trigger.tgrelid and pg_constraint.conrelid reference the oid of the
relation, not relfilenode. Initially, relfilenode happens to have the
same value, but as you noticed, some commands like ALTER TABLE change it.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

pgsql-bugs by date:

Previous
From: "S R Madhu"
Date:
Subject: BUG #3424: Not able to drop trigger(RI_trigger*) on specific table.
Next
From: "David Flater"
Date:
Subject: BUG #3426: Rows disappear from complex join