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

From Fabien COELHO
Subject Re: Why forbid "INSERT INTO t () VALUES ();"
Date
Msg-id alpine.DEB.2.22.394.2006262216500.3589538@pseudo
Whole thread Raw
In response to Re: Why forbid "INSERT INTO t () VALUES ();"  (Isaac Morland <isaac.morland@gmail.com>)
List pgsql-hackers
Hello Isaac,

> This is not the only area where empty tuples are not supported. Consider:
>
> PRIMARY KEY ()
>
> This should mean the table may only contain a single row, but is not
> supported.

Yep. This is exactly the kind of case about which I was trying the 
command, after reading Bruce Momjian blog 
(https://momjian.us/main/blogs/pgblog/2020.html#June_22_2020) about 
one-row tables and thinking about how to improve it and allow enforcing a 
singleton simply, which is a thing I needed several times in the past.

> On the plus side, empty rows are supported, although the explicit ROW
> keyword is required.

Yet another weirdness.

Thanks for the comments.

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: PG 13 release notes, first draft
Next
From: Peter Geoghegan
Date:
Subject: Re: Default setting for enable_hashagg_disk