Re: ALTER TABLE RENAME fix

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brent Verner <brent(at)rcfile(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: ALTER TABLE RENAME fix
Date: 2001-11-11 03:42:59
Message-ID: 18241.1005450179@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Brent Verner <brent(at)rcfile(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Brent Verner 2001-11-11 04:25:42 Re: ALTER TABLE RENAME fix
Previous Message Brent Verner 2001-11-11 03:39:12 Re: ALTER TABLE RENAME fix