Re: table alias

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: table alias
Дата
Msg-id 6EE64EF3AB31D5448D0007DD34EEB34101AE37@Herge.rcsinc.local
обсуждение исходный текст
Ответ на table alias  (Bob.Henkel@hartfordlife.com)
Список 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 по дате отправления:

Предыдущее
От: Bob.Henkel@hartfordlife.com
Дата:
Сообщение: table alias
Следующее
От: Bob.Henkel@hartfordlife.com
Дата:
Сообщение: Re: table alias