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.
GetSchema Triggers amd arguments
1. Thank you for your suggestions about GetSchema("Triggers", ...) improvement. We will notify you about the results of our investigation.
2.
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.
2.
Have you tried GetSchema("Arguments", ...) for functions or trigger functions?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.
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.
Cool.Shalex wrote:1. Thank you for your suggestions about GetSchema("Triggers", ...) improvement. We will notify you about the results of our investigation.
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.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.