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

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Why forbid "INSERT INTO t () VALUES ();"
Date: 2020-06-26 20:26:24
Message-ID: alpine.DEB.2.22.394.2006262216500.3589538@pseudo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2020-06-26 20:53:05 Re: Default setting for enable_hashagg_disk
Previous Message Alvaro Herrera 2020-06-26 20:23:26 Re: PG 13 release notes, first draft