[PATCH] parser: optionally warn about missing AS for column and table aliases

Поиск
Список
Период
Сортировка
От Oskari Saarenmaa
Тема [PATCH] parser: optionally warn about missing AS for column and table aliases
Дата
Msg-id 20140905203810.GG10465@saarenmaa.fi
обсуждение исходный текст
Ответы Re: [PATCH] parser: optionally warn about missing AS for column and table aliases  (Marko Tiikkaja <marko@joh.to>)
Список pgsql-hackers
I wrote the attached patch to optionally emit warnings when column or table
aliases are used without the AS keyword after errors caused by typos in
statements turning unintended things into aliases came up twice this week.
First in a discussion with a colleague who was surprised by a 1 row result
for the query 'SELECT COUNT(*) files' and again in the "pl/pgsql 2" thread
as plpgsql currently doesn't throw an error if there are more result columns
than output columns (SELECT a b INTO f1, f2).

The patch is still missing documentation and it needs another patch to
modify all the statements in psql & co to use AS so you can use things like
\d and tab-completion without triggering the warnings.  I can implement
those changes if others think this patch makes sense.

/ Oskari

Вложения

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: Allowing implicit 'text' -> xml|json|jsonb (was: PL/pgSQL 2)
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: [PATCH] parser: optionally warn about missing AS for column and table aliases