pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
list user created triggers
3+ messages / 1 participants
[nested] [flat]

* list user created triggers
@ 2008-03-11 13:38 sathiya psql <sathiya.psql@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: sathiya psql @ 2008-03-11 13:38 UTC (permalink / raw)
  To: pgsql-performance

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);



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: list user created triggers
@ 2008-03-12 04:07 sathiya psql <sathiya.psql@gmail.com>
  2008-03-12 05:17 ` Re: list user created triggers sathiya psql <sathiya.psql@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: sathiya psql @ 2008-03-12 04:07 UTC (permalink / raw)
  To: Sergey Benner <sergey.benner@gmail.com>; +Cc: pgsql-performance

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..

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
>
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: list user created triggers
  2008-03-12 04:07 Re: list user created triggers sathiya psql <sathiya.psql@gmail.com>
@ 2008-03-12 05:17 ` sathiya psql <sathiya.psql@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: sathiya psql @ 2008-03-12 05:17 UTC (permalink / raw)
  To: Sergey Benner <sergey.benner@gmail.com>; +Cc: pgsql-performance

>
> 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

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2008-03-12 05:17 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-03-11 13:38 list user created triggers sathiya psql <sathiya.psql@gmail.com>
2008-03-12 04:07 Re: list user created triggers sathiya psql <sathiya.psql@gmail.com>
2008-03-12 05:17 ` sathiya psql <sathiya.psql@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox