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

Поиск
Список
Период
Сортировка
От ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Тема Re: Why forbid "INSERT INTO t () VALUES ();"
Дата
Msg-id 875zbgnljv.fsf@wibble.ilmari.org
обсуждение исходный текст
Ответ на Re: Why forbid "INSERT INTO t () VALUES ();"  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Why forbid "INSERT INTO t () VALUES ();"  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> 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?

FWIW, MySQL (and MariaDB) only support INSERT INTO t () VALUES (), not
DEFAULT VALUES.  We have added syntax for MySQL compatibility in the
past, e.g. the CONCAT() function.

- ilmari
-- 
"A disappointingly low fraction of the human race is,
 at any given time, on fire." - Stig Sandbeck Mathisen



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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: should libpq also require TLSv1.2 by default?
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Why forbid "INSERT INTO t () VALUES ();"