GetSchema Triggers amd arguments

GetSchema Triggers amd arguments

Postby marty » Wed 18 May 2011 06:51

I'm using PgSqlConnection.GetSchema to look at the triggers collection.
It returns name, schema, definer, language, argumentcount,oid etc...
What I need is the table the trigger refers to.

I presume under the covers, the provider is selecting from pg_trigger, like this example: http://www.alberton.info/postgresql_meta_info.html
In which case it's a simple join to pg_class on pg_trigger.tgrelid = pg_class.oid to read the relname.

For the time being I'm using a form of the select trigger metadata statement from that webpage directly, which tells me details of before/after insert/delete/update and event.

It would be nice to be able to call GetSchema triggers with that extra information.

There's also a GetSchema arguments collection. This is always empty for me. When I use the example function from the page http://www.alberton.info/postgresql_meta_info.html I can see the function arguments.
marty
 
Posts: 4
Joined: Mon 18 Apr 2011 13:41

Postby Shalex » Wed 18 May 2011 15:45

1. Thank you for your suggestions about GetSchema("Triggers", ...) improvement. We will notify you about the results of our investigation.

2.
marty wrote:There's also a GetSchema arguments collection. This is always empty for me. When I use the example function from the page http://www.alberton.info/postgresql_meta_info.html I can see the function arguments.

Have you tried GetSchema("Arguments", ...) for functions or trigger functions?
The "Arguments" collection has these restrictions in the following order:
0 - Schema name
1 - Function name
2 - User name
3 - Type
4 - Function OID (for overload functions)

I have tried the GetSchema("Arguments", new string[] {"schema_name", "function_name") scenario. It works in my environment.
Shalex
Devart Team
 
Posts: 7774
Joined: Thu 14 Aug 2008 12:44

Postby marty » Thu 19 May 2011 06:11

Shalex wrote:1. Thank you for your suggestions about GetSchema("Triggers", ...) improvement. We will notify you about the results of our investigation.

Cool.

Shalex wrote:2. Have you tried GetSchema("Arguments", ...) for functions or trigger functions?
I have tried the GetSchema("Arguments", new string[] {"schema_name", "function_name") scenario. It works in my environment.

Ah, now I see how it works. I assumed I could load the arguments for all functions by not passing the restriction. Thanks for the clarification.
marty
 
Posts: 4
Joined: Mon 18 Apr 2011 13:41


Return to dotConnect for PostgreSQL