identifying duplicate RI triggers

From: "culley harrelson" <culley(at)ml1(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: identifying duplicate RI triggers
Date: 2002-11-08 15:20:00
Message-ID: 20021108152000.E14002FD16@server4.fastmail.fm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I started looking at the RI triggers in a database that started in 7.0.
Over time has been migrated to 7.1, 7.2, and 7.2.3 and I think all the
dumping and reloading has left me with some extra triggers. When do see
this:

siteadmin=# select tgname, tgargs from pg_trigger where tgname in
('RI_ConstraintTrigger_1462942','RI_ConstraintTrigger_1462994');
tgname |
tgargs
------------------------------+-----------------------------------------------------------------------------------------
RI_ConstraintTrigger_1462942 |
<unnamed>\000fe_user\000fe_user_type\000UNSPECIFIED\000user_type_id\000user_type_id\000
RI_ConstraintTrigger_1462994 |
<unnamed>\000fe_user\000fe_user_type\000UNSPECIFIED\000user_type_id\000user_type_id\000
(2 rows)

I am looking at identical triggers right? On the referenced side I see
the same thing:

siteadmin=# select tgname, tgargs from pg_trigger where tgname in
('RI_ConstraintTrigger_1462944', 'RI_ConstraintTrigger_1462946',
'RI_Constrain
tTrigger_1462996','RI_ConstraintTrigger_1462998');
tgname |
tgargs
------------------------------+-----------------------------------------------------------------------------------------
RI_ConstraintTrigger_1462944 |
<unnamed>\000fe_user\000fe_user_type\000UNSPECIFIED\000user_type_id\000user_type_id\000
RI_ConstraintTrigger_1462946 |
<unnamed>\000fe_user\000fe_user_type\000UNSPECIFIED\000user_type_id\000user_type_id\000
RI_ConstraintTrigger_1462996 |
<unnamed>\000fe_user\000fe_user_type\000UNSPECIFIED\000user_type_id\000user_type_id\000
RI_ConstraintTrigger_1462998 |
<unnamed>\000fe_user\000fe_user_type\000UNSPECIFIED\000user_type_id\000user_type_id\000
(4 rows)

Are these tied together in any way? My guess is
RI_ConstraintTrigger_1462942, RI_ConstraintTrigger_1462944 are
RI_ConstraintTrigger_1462946 a set and should be deleted together? Just
for curiosity sake... could I delete RI_ConstraintTrigger_1462942,
RI_ConstraintTrigger_1462996 and RI_ConstraintTrigger_1462998 and still
have a valid trigger?

I am curious if foreign keys are easier to manage if created with the
"create contraint" syntax rather than the create table foo(bar integer
not null references table2(col2)); syntax?

culley

ps. sorry if this is garbled-- haven't posted through this interface
before...

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Russell Aspinwall 2002-11-08 15:20:27 Re: inet/cidr data types
Previous Message Neil Conway 2002-11-08 15:14:32 Re: command