Re: DROP COLUMN Progress

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DROP COLUMN Progress
Date: 2002-07-08 04:16:51
Message-ID: 200207080416.g684GqT11970@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christopher Kings-Lynne wrote:
> /*
> * Scan the user column names (or aliases) for a match. Complain if
> * multiple matches.
> */
> foreach(c, rte->eref->colnames)
> {
> /* @@ SKIP DROPPED HERE? @@ */
> attnum++;
> if (strcmp(strVal(lfirst(c)), colname) == 0)
> {
> if (result)
> elog(ERROR, "Column reference \"%s\" is
> ambiguous", colname);
> result = (Node *) make_var(pstate, rte, attnum);
> rte->checkForRead = true;
> }
> }
>
>
> I'm thinking that I should put a 'SearchSysCacheCopy' where my @@ comment is
> to retrieve the attribute by name, and then do a check to see if it's
> dropped. Is that the best/fastest way of doing things? Seems unfortunate
> to add a another cache lookup in every parsed query...

I am still looking but perhaps you could supress dropped columns from
getting into eref in the first place.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Steve Lane 2002-07-08 04:40:44 Re: I am being interviewed by OReilly
Previous Message Christopher Kings-Lynne 2002-07-08 04:06:07 Re: DROP COLUMN Progress