Re: table alias - Mailing list pgsql-hackers-win32

From Merlin Moncure
Subject Re: table alias
Date
Msg-id 6EE64EF3AB31D5448D0007DD34EEB34101AE37@Herge.rcsinc.local
Whole thread Raw
In response to table alias  (Bob.Henkel@hartfordlife.com)
List pgsql-hackers-win32
> I'm running a binary snapshot from two days ago.  When I run a update
with
> aliases the SQL doesn't work.  The alias does work if I run just a
select
> statement however.  Is this suppose to be like this.  If not is it
only
> broken in the 7.5 WIN32 build?

Look at the grammar for select and update (\h update, \h select) in
psql.  You will notice that select has grammar for alias, update does
not

where from_item can be one of:

    [ ONLY ] table_name [ * ] [ [ AS ] alias [ ( column_alias [, ...] )
] ]
    ( select ) [ AS ] alias [ ( column_alias [, ...] ) ]
    function_name ( [ argument [, ...] ] ) [ AS ] alias [ ( column_alias
[, ...] | column_definition

there is no reason to alias the update statement because you can only
specify one table, so it is not really necessary to prefix each column
with the table name (and thus no reason for an alias).  I didn't check,
but the unix version almost certainly works the same

Merlin


pgsql-hackers-win32 by date:

Previous
From: Bob.Henkel@hartfordlife.com
Date:
Subject: table alias
Next
From: Bob.Henkel@hartfordlife.com
Date:
Subject: Re: table alias