Re: Why forbid "INSERT INTO t () VALUES ();"

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why forbid "INSERT INTO t () VALUES ();"
Дата
Msg-id 2230044.1593028441@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Why forbid "INSERT INTO t () VALUES ();"  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: Why forbid "INSERT INTO t () VALUES ();"  (ilmari@ilmari.org (Dagfinn Ilmari Mannsåker))
Re: Why forbid "INSERT INTO t () VALUES ();"  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
Fabien COELHO <coelho@cri.ensmp.fr> writes:
>>>   INSERT INTO t() VALUES ();

> I'm still unclear why it would be forbidden though, it seems logical to 
> try that, whereas the working one is quite away from the usual syntax.

It's forbidden because the SQL standard forbids it.

We allow zero-column syntaxes in some other places where SQL forbids
them, but that's only because there is no reasonable alternative.
In this case, there's a perfectly good, standards-compliant alternative.
So why encourage people to write unportable code?

            regards, tom lane



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: SIGSEGV from START_REPLICATION 0/XXXXXXX in XLogSendPhysical ()at walsender.c:2762
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: xid wraparound danger due to INDEX_CLEANUP false