pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedQuestion regardding info available in customer C trigger function
2+ messages / 2 participants
[nested] [flat]
* Question regardding info available in customer C trigger function
@ 2001-04-25 01:13 Curtis H. Wilbar Jr. <curtis@hawkmountain.net>
2001-04-25 20:27 ` Re: Question regardding info available in customer C trigger function Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Curtis H. Wilbar Jr. @ 2001-04-25 01:13 UTC (permalink / raw)
To: pgsql-docs
I've been scouring the docs, but have not come up with answers for
all my questions.
I found out how to deal with trigger function arguments via PG_GETARG_xxx.
However, is there a way in my C function to determine the name of the
table and of the database that caused the trigger. This trigger will
be used in several tables in several databases, and while I could pass
these names as parameters, it would be much easier to be able to determine
this via the context when called.
Any info would be greatly appreciated.
-- Curt
Curtis H. Wilbar Jr.
Hawk Mountain Networks
curtis@hawkmountain.net
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Question regardding info available in customer C trigger function
2001-04-25 01:13 Question regardding info available in customer C trigger function Curtis H. Wilbar Jr. <curtis@hawkmountain.net>
@ 2001-04-25 20:27 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2001-04-25 20:27 UTC (permalink / raw)
To: Curtis H. Wilbar Jr. <curtis@hawkmountain.net>; +Cc: pgsql-docs
"Curtis H. Wilbar Jr." <curtis@hawkmountain.net> writes:
> However, is there a way in my C function to determine the name of the
> table and of the database that caused the trigger.
The current database name is not passed around as a parameter, but you
can get it from the global variable DatabaseName. As for the table
name, try RelationGetRelationName(triggerdata->tg_relation).
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-04-25 20:27 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-04-25 01:13 Question regardding info available in customer C trigger function Curtis H. Wilbar Jr. <curtis@hawkmountain.net>
2001-04-25 20:27 ` Tom Lane <tgl@sss.pgh.pa.us>
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