From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thiemo Kellner <thiemo@gelassene-pferde.biz>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Is this a buggy behavior?
Date: Sun, 24 Mar 2024 11:17:11 -0400
Message-ID: <2005111.1711293431@sss.pgh.pa.us> (raw)
In-Reply-To: <51eb3063-1d90-40c6-a8c6-9a77fe105a61@gelassene-pferde.biz>
References: <CAD=mzVV6SKgj0-vO2+vx2x3qHXDw6ZCSCkm3EnAKpwkOPjUgrA@mail.gmail.com>
<yv3w7fykxqfqyio2mwentwipoojror5ebwhthpw4xfoiwaxikj@jri3ds4u7xfr>
<51eb3063-1d90-40c6-a8c6-9a77fe105a61@gelassene-pferde.biz>
Thiemo Kellner <thiemo@gelassene-pferde.biz> writes:
> Am 24.03.2024 um 15:54 schrieb Erik Wienhold:
>> This is required by the SQL standard: columns of a primary key must be
>> NOT NULL. Postgres automatically adds the missing NOT NULL constraints
>> when defining a primary key. You can verify that with \d test1 in psql.
> To me, this behaviour, while correct, is not too concise. I wished, that
> PG issued a warning about a definition conflict. In PostgreSQL, a PK
> must always be not nullable, so explicitly defining on of a PK's columns
> as nullable is contradictory, one should get notified of.
To do that, we'd have to remember that you'd said NULL, which we
don't: the word is just discarded as a noise clause. Considering
that this usage of NULL isn't even permitted by the SQL standard,
that seems like a bit too much work.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, thiemo@gelassene-pferde.biz, pgsql-general@lists.postgresql.org
Subject: Re: Is this a buggy behavior?
In-Reply-To: <2005111.1711293431@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox