Re: Code questions

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Code questions
Date: 2002-06-23 08:55:24
Message-ID: Pine.LNX.4.21.0206231842110.29067-100000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 23 Jun 2002, Christopher Kings-Lynne wrote:

> Hi All,
>
> Whereabouts in the code is the '*' expanded into the list of valid columns

See the rule 'target_el' in gram.y. The SelectStmt node is processed
further down the parser in analyze.c: see transformStmt(),
transformSelectStmt() and transformTargetList().

> and also where are the columns specified in the select arguments (or
> whereever) checked for validity?

This is pretty easy to discover by working backward from the
elog(ERROR) produced when you select a non-existent attribute from a
relation:

ERROR: Attribute 'nonexistent' not found

This is generated by transformIdent(), called from transformExpr, called
from transformTargetEntry. The latter is called by transformTargetList()
when it the attribute is not of the form '*' or 'relation.*' or when we
don't know if the attribute is actually an attribute.

> Chris

Gavin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message J. R. Nield 2002-06-23 12:37:53 Re: Index Scans become Seq Scans after VACUUM ANALYSE
Previous Message Christopher Kings-Lynne 2002-06-23 08:27:04 Code questions