Re: Planned cleanups in attribute parsing - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Planned cleanups in attribute parsing
Date
Msg-id 27434.1015456279@sss.pgh.pa.us
Whole thread Raw
In response to Re: Planned cleanups in attribute parsing  (Thomas Lockhart <lockhart@fourpalms.org>)
List pgsql-hackers
Thomas Lockhart <lockhart@fourpalms.org> writes:
>> Alias: for AS clauses.  Carries a "char *aliasname" and a List of column
>> alias names.  The current uses of Attr in range table entries would
>> become Alias.

> Is there a one-to-one relationship between the alias and the column? Or
> does the list of column names actually have more than one entry? Or is
> the "list of column alias names" the qualified name of the column?

Basically type Alias represents an AS clause, which can come in two
flavors: just "AS foo", or "AS foo(bar1,bar2,bar3)" for renaming a
FROM-list item along with its columns.  So the list of names in this
case represents individual column names, *not* a qualified name.
One reason that I want to separate this from Attr is that the list
of names has a totally different meaning from what it has in Attr.

>> ColumnRef: for referencing a column (possibly qualified, possibly with
>> array subscripts) in the raw grammar output.  Carries a List of names
>> which correspond to the dotted names (eg, a.b.c), plus a List of array
>> subscripting info (currently called "indirection" in Attr, but I wonder
>> if "subscripts" wouldn't be a more useful name).

> Would it be helpful to separate the name itself from the qualifying
> prefixes? istm that most use cases would require this anyway...

Remember this is raw parsetree output; the grammar does not have a real
good idea which names are qualifiers and which are field names and/or
function names.  The parse analysis phase will rip the list apart and
determine what's what.  The output of that will be some other node type
(eg, a Var).
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: Planned cleanups in attribute parsing
Next
From: "Gaston Micheri"
Date:
Subject: Odbc, postgresql and disconnected recordsets