Brent Verner <brent@rcfile.org> writes:
> exactly. which is why we've gotta inspecy the relname to determine
> which of the attnames to modify.
My point is that inspecting the tgfoid is safer, because it
unambiguously tells you what you are looking at. The relname is
inherently ambiguous because it could be the same on both sides.
Also, depending on the relname is highly fragile if you're trying
to handle the RENAME TABLE case --- did you already update (one
side of) this trigger, or not?
> right. I was not proposing that as any bit of info to use, just an
> example that there is no useful way (in a pg_trigger scan) to know
> if the relname is a PK or FK rel.
There is: the tgfoid, which is indirectly the same way that the trigger
functions themselves know what to do.
regards, tom lane