pg_get_triggerdef can't find the trigger using OID.

From: AI Rumman <rummandba(at)gmail(dot)com>
To: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: pg_get_triggerdef can't find the trigger using OID.
Date: 2013-08-16 15:01:56
Message-ID: CAGoODpfqHC6txFUWm-A-ztorGGKTGQgD5qf4-y4usUQBGrXjyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Why can't pg_get_triggerdef find the trigger using OID.

testdb=# SELECT
testdb-# p.oid,
testdb-# n.nspname as "Schema",
testdb-# p.proname as "Name",
testdb-# pg_catalog.pg_get_function_result(p.oid) as "Result data type",
testdb-# pg_catalog.pg_get_function_arguments(p.oid) as "Argument data
types",
testdb-# CASE
testdb-# WHEN p.proisagg THEN 'agg'
testdb-# WHEN p.proiswindow THEN 'window'
testdb-# WHEN p.prorettype = 'pg_catalog.trigger'::pg_catalog.regtype
THEN 'trigger'
testdb-# ELSE 'normal'
testdb-# END as "Type"
testdb-# FROM pg_catalog.pg_proc p
testdb-# LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace
testdb-# WHERE pg_catalog.pg_function_is_visible(p.oid)
testdb-# AND n.nspname <> 'pg_catalog'
testdb-# AND n.nspname <> 'information_schema'
testdb-# ORDER BY 1, 2, 4;
oid | Schema | Name | Result data type | Argument
data types | Type
-------+--------+---------+------------------+--------------------------------------------------------------+---------
18249 | public | test_f | trigger |
| trigger

testdb=# select pg_get_triggerdef(18249);
ERROR: could not find tuple for trigger 18249

Thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message bricklen 2013-08-16 15:30:30 Re: pg_get_triggerdef can't find the trigger using OID.
Previous Message David Johnston 2013-08-16 14:34:02 Re: need help