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@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026