Re: [HACKERS] Almost there on column aliases - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Almost there on column aliases
Date
Msg-id 15745.950803057@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Almost there on column aliases  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-hackers
Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> I've just looked it up in the Date book: table aliases are optional in
> general, but column aliases require a table alias. The bnf looks like

>   table [ [ AS ] range-variable [ ( column-commalist ) ] ]

OK, but that doesn't really solve my concern about rule bloat, because
if you write "FROM table alias", you'll still get a list of column names
appended to that by the system.

Here is a possible answer that I think would address both our concerns:
keep track of how many column aliases the user actually wrote (without
counting the Attr-list entries added by the system for its internal
convenience), and dump only the user-supplied aliases in rule strings.
This'd be easy enough to do with an extra field in Attr nodes.
It'd not only preserve compactness in the cases we previously handled,
but it'd make the reverse-listed display of rules more like the original
query in cases where the user did write some aliases (but not a full
set).
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Definitional issue for INET types
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Date/time types: big change