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

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Thomas Kellerer <shammat(at)gmx(dot)net>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Why forbid "INSERT INTO t () VALUES ();"
Date: 2020-06-24 19:34:34
Message-ID: alpine.DEB.2.22.394.2006242126030.2665420@pseudo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hallo Thomas,

>>   INSERT INTO t() VALUES ();
>>
>> This is forbidden by postgres, and also sqlite.
>>
>> Is there any good reason why this should be the case?
>
> Maybe because
>
> insert into t default values;
>
> exists (and is standard SQL if I'm not mistaken)

That's a nice alternative I did not notice. Well, not an alternative as
the other one does not work.

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.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2020-06-24 19:36:24 Re: Default setting for enable_hashagg_disk
Previous Message Andres Freund 2020-06-24 19:31:22 Re: Default setting for enable_hashagg_disk