Re: Is this a buggy behavior? - Mailing list pgsql-general

From Christophe Pettus
Subject Re: Is this a buggy behavior?
Date
Msg-id 72EB494A-3644-4B0B-A18B-2672D5842AF5@thebuild.com
Whole thread Raw
In response to Re: Is this a buggy behavior?  (Thiemo Kellner <thiemo@gelassene-pferde.biz>)
Responses Re: Is this a buggy behavior?  (Ron Johnson <ronljohnsonjr@gmail.com>)
List pgsql-general

> On Mar 25, 2024, at 02:50, Thiemo Kellner <thiemo@gelassene-pferde.biz> wrote:
> My bad. I was under the impression that the create table statement was an atomic process/transaction with all its
bellsand whistles for constraints and keys, instead of a succession of alter statements. 

That may be a bit judgmental. :-)  It's not a series of ALTER statements, really.  The basic issue is that the parser
throwsaway a bare NULL very early in the process, so it is not available to consult at the point that PostgreSQL is
creatingthe constraint.  The underlying implementation of the actual table creation isn't the issue here. 

There seems to be general consensus that:

1. It would be handy to have a warning in the particular case that NULL is specified, however,
2. It would be undesirable to have a warning in the case where no NULL at all is specified, which means,
3. The presence of an existing bare NULL would have to be retained through the whole process, which is,
4. Not trivial.

The reason the SQL standard is relevant here is that if bare NULL were part of the standard, that would be an argument
fortaking the pains.  Since it's not, it's not clear that doing the work to add the warning is worth the effort. 


pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: PostgreSQL as advanced job queuing system
Next
From: Christophe Pettus
Date:
Subject: No warning for a no-op REVOKE