Re: Why forbid "INSERT INTO t () VALUES ();" - Mailing list pgsql-hackers

From David Rowley
Subject Re: Why forbid "INSERT INTO t () VALUES ();"
Date
Msg-id CAApHDvquT6uG-84nui=ixax-HdW0qfZ5vwa71kD6KTXDOpXK1A@mail.gmail.com
Whole thread Raw
In response to Re: Why forbid "INSERT INTO t () VALUES ();"  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers
On Thu, 25 Jun 2020 at 16:56, Fabien COELHO <coelho@cri.ensmp.fr> wrote:
> It also means that if for some reason someone wants to insert several such
> all-default rows, they have to repeat the insert, as "VALUES (), ();"
> would not work, so it is also losing a corner-corner case capability
> without obvious reason.

This is not a vote in either direction but just wanted to say that
during 7e413a0f8 where multi-row inserts were added to pg_dump, a
special case had to be added to support tables with no columns.  We
cannot do multi-inserts for that so are forced to fall back on
one-row-per-INSERT.

However, even if we had this syntax I imagine it would be unlikely
we'd change pg_dump to use it since we want to be as standard
compliant as possible when dumping INSERTs since it appears the only
genuine use-case for that is for importing the data into some other
relational database.

David



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Open Item: Should non-text EXPLAIN always show properties?
Next
From: Daniel Gustafsson
Date:
Subject: Re: Online checksums patch - once again