Re: Add Missing From?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Add Missing From?
Дата
Msg-id 29527.1092158218@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Add Missing From?  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> * Allow an alias to be provided for the target table in UPDATE/DELETE
>> 
>> This is not SQL-spec but many DBMSs allow it.

> I don't think we would ever do the above item.

Why not?  You can hardly argue that "it's not SQL spec" while
simultaneously putting in a much larger extension to the spec.

> I see no purpose to
> allowing the UPDATE/DELETE table to have an alias

Brevity.  If you are really updating AVeryLongSchemaName.AVeryLongTableName
then you would reasonably want to have an alias for that.  In the pure
SQL-spec syntax it's not so important because there's seldom a need to
name the table again within the query.  But in a self-join situation you
would be forced to name the target table within the query, and then a
shorter alias would be both easier to type and less prone to confusion.
(Even in pure SQL, you may need to name the table again for references
within subqueries that have duplicate column names.)
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Add Missing From?
Следующее
От: Gaetano Mendola
Дата:
Сообщение: Re: VACUUM DELAY