Re: INSERT ... ON CONFLICT syntax issues

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: INSERT ... ON CONFLICT syntax issues
Дата
Msg-id 20150507173722.GD12950@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: INSERT ... ON CONFLICT syntax issues  (Heikki Linnakangas <hlinnaka@iki.fi>)
Ответы Re: INSERT ... ON CONFLICT syntax issues  (Peter Geoghegan <pg@heroku.com>)
Re: INSERT ... ON CONFLICT syntax issues  (Geoff Winkless <pgsqladmin@geoff.dj>)
Список pgsql-hackers
On 2015-05-07 16:15:18 +0300, Heikki Linnakangas wrote:
> On 05/07/2015 12:01 AM, Andres Freund wrote:
> >6. The tablename and EXCLUDED? Possibility with the ability to specify
> >    an AS for INSERT INTO foo AS whatever?
> 
> If we don't allow "AS whatever", and you create a table called "excluded",
> you're stuck with the ambiguity in the DO UPDATE statement as you can't
> alias either one. So we have to add support for "INSERT INTO foo AS
> whatever", if we go with <tablename> and EXCLUDED.
> 
> Does anyone see a problem with "INSERT INTO foo AS whatever"? It seems
> pretty straightforward to implement.

I don't see a problem at all, with one exception: If we want the AS to
be optional like in a bunch of other places, we have to either promote
VALUES to a reserved keyword, only accept unreserved keywords, or play
precedence games. I think it'd be perfectly fine to not make AS
optional.

Greetings,

Andres Freund



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: BRIN range operator class
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: INSERT ... ON CONFLICT syntax issues