Foreign Key written as a trigger

From: "George Woodring" <george(dot)woodring(at)iglass(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Foreign Key written as a trigger
Date: 2005-07-11 13:58:11
Message-ID: 54D4D0185B2D114A84630606A603DC924F49C8@iglassmail.istructure.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a database that has been upgrade numerous times (Started about
7.1 and is not 7.4.8). The table has 2 foreign keys on it, but when I
look at the table I see that the FK applied before 7.4.X is written as a
trigger. Everything seems to work, I was just wondering if there are
any performance reasons to change the trigger to a FK.

issp=> \d notpoll
Table "public.notpoll"
Column | Type | Modifiers
-------------+---------+-----------
notpollid | integer | not null
pollgrpid | integer |
notgroupsid | integer |
Indexes:
"notpoll_pkey" primary key, btree (notpollid)
"notpoll_pollgrpid_key" unique, btree (pollgrpid)
Foreign-key constraints:
"pollgrp_exists" FOREIGN KEY (pollgrpid) REFERENCES
pollgrpinfo(pollgrpid) ON DELETE CASCADE
Triggers:
"RI_ConstraintTrigger_2137396" AFTER INSERT OR UPDATE ON notpoll
FROM notgroups NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE
PROCEDURE "RI_FKey_check_ins"('notgroups_exists', 'notpoll',
'notgroups', 'UNSPECIFIED', 'notgroupsid', 'notgroupsid')

Thanks,
Woody

----------------------------------------
iGLASS Networks
211-A S. Salem St
Apex NC 27502
(919) 387-3550 x813
www.iglass.net

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-07-11 14:17:18 Re: Foreign Key written as a trigger
Previous Message Tom Lane 2005-07-11 13:41:02 Re: DB/clog corruption