Обсуждение: list user created triggers
how to find trigger names in my database ? using psql 7.4 the following query shows system triggers, i want only to list the triggers created by me select relname, tgname, tgtype, proname, prosrc, tgisconstraint, tgconstrname, tgconstrrelid, tgdeferrable, tginitdeferred, tgnargs, tgattr, tgargs from (pg_trigger join pg_class on tgrelid=pg_class.oid) join pg_proc on (tgfoid=pg_proc.oid);
thanks...
after this query also it is showing default triggers ( am very much worried that how the system triggers are created using my username ....
ok i posted this in the group you specified..
after this query also it is showing default triggers ( am very much worried that how the system triggers are created using my username ....
ok i posted this in the group you specified..
On Tue, Mar 11, 2008 at 8:03 PM, Sergey Benner <sergey.benner@gmail.com> wrote:
Again :) Try this query.
select usename,relname, tgname, tgtype, proname, prosrc, tgisconstraint,
tgconstrname, tgconstrrelid, tgdeferrable, tginitdeferred, tgnargs,
tgattr, tgargs from (pg_trigger join pg_class c on tgrelid=c.oid )
join pg_proc on (tgfoid=pg_proc.oid) join pg_user pu on c.relowner=pu.usesysid where pu.usename='YOURUSERNAME';
Please post such questions to the pgsql-sql@postgresql.org list.
Cheers,
Sergey
select usename,relname, tgname, tgtype, proname, prosrc, tgisconstraint,
tgconstrname, tgconstrrelid, tgdeferrable, tginitdeferred, tgnargs,
tgattr, tgargs from (pg_trigger join pg_class c on tgrelid=c.oid )
join pg_proc on (tgfoid=pg_proc.oid) join pg_user pu on c.relowner=pu.usesysid where pu.usename='YOURUSERNAME';
yes i got the answer by this query..
select relname, tgname, tgtype, proname, prosrc, tgisconstraint,
tgconstrname, tgconstrrelid, tgdeferrable, tginitdeferred, tgnargs,
tgattr, tgargs from (pg_trigger join pg_class on tgrelid=pg_class.oid)
join pg_proc on (tgfoid=pg_proc.oid) where tgname not ilike '%constraint%' and tgname not ilike 'pg%';
---- the query which you had given shown the implicit triggers which is created for maintaining the constraints..
-- so the query which i had given will show the user created triggers...
THANKS