Constraint Triggers request

From: "Donald Fraser" <postgres(at)kiwi-fraser(dot)net>
To: "[pgADMIN]" <pgadmin-support(at)postgresql(dot)org>
Subject: Constraint Triggers request
Date: 2006-05-09 16:35:47
Message-ID: 007501c67386$a07daac0$0264a8c0@demolish1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Do you think in a later version you can show non-system constraint triggers that have been created by the user via:
CREATE CONSTRAINT TRIGGER ?

The current query pgAdmin uses to get trigger function information is:

SELECT t.oid, t.*, relname, nspname, des.description
FROM pg_trigger t
JOIN pg_class cl ON cl.oid=tgrelid
JOIN pg_namespace na ON na.oid=relnamespace
LEFT OUTER JOIN pg_description des ON des.objoid=t.oid
WHERE NOT tgisconstraint
AND tgrelid = xxxx::oid
ORDER BY tgname

where xxxx is the oid of the table.

You could easily get the same result, which would include user defined constraint triggers by using:

SELECT t.oid, t.*, relname, nspname, des.description
FROM pg_trigger t
JOIN pg_class cl ON cl.oid=tgrelid
JOIN pg_namespace na ON na.oid=relnamespace
LEFT OUTER JOIN pg_description des ON des.objoid=t.oid
WHERE tgconstrrelid = 0::oid
AND tgrelid = xxxx::oid
ORDER BY tgname

Obviously you may want to change the reverse engineered SQL accordingly for constraint triggers.

Cheers
Donald Fraser

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Andrew Lazarus 2006-05-09 17:44:32 Re: [pgadmin-support] Segmentation fault in GUI
Previous Message Raphaël Enrici 2006-05-09 07:00:33 Re: [pgadmin-support] Segmentation fault in GUI