Re: Problems with outer joins in 7.1beta5

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Barry Lind <barry(at)xythos(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Problems with outer joins in 7.1beta5
Date: 2001-03-16 19:58:38
Message-ID: 25866.984772718@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Barry Lind <barry(at)xythos(dot)com> writes:
> What I would expect the syntax to be is:
> table as alias (columna as aliasa, columnb as aliasb,...)
> This will allow the query to work regardless of what the table column
> order is. Generally the SQL spec has tried not to tie query behaviour
> to the table column order.

Unfortunately, the spec authors seem to have forgotten that basic design
rule when they wrote the aliasing syntax. Column alias lists are
position-sensitive:

<table reference> ::=
<table name> [ [ AS ] <correlation name>
[ <left paren> <derived column list> <right paren> ] ]
| <derived table> [ AS ] <correlation name>
[ <left paren> <derived column list> <right paren> ]
| <joined table>

<derived column list> ::= <column name list>

<column name list> ::=
<column name> [ { <comma> <column name> }... ]

SQL99 seems to be no better. Sorry.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2001-03-16 19:59:17 Re: Re: create user, user exists
Previous Message Tom Lane 2001-03-16 19:52:33 Re: create user, user exists

Browse pgsql-hackers by date

  From Date Subject
Next Message Alfred Perlstein 2001-03-16 20:15:58 Re: Re[4]: Allowing WAL fsync to be done via O_SYNC
Previous Message Martin A. Marques 2001-03-16 19:47:54 problems with startup script on upgrade