From: | Ron Johnson <ronljohnsonjr(at)gmail(dot)com> |
---|---|
To: | "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Is this a buggy behavior? |
Date: | 2024-03-25 15:38:38 |
Message-ID: | CANzqJaBG5m2Mxi3E94tRusDEL1=FyLux3m568cCfGdwVaViVhA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Mon, Mar 25, 2024 at 9:49 AM Christophe Pettus <xof(at)thebuild(dot)com> wrote:
>
>
> > On Mar 25, 2024, at 02:50, Thiemo Kellner <thiemo(at)gelassene-pferde(dot)biz>
> wrote:
> > My bad. I was under the impression that the create table statement was
> an atomic process/transaction with all its bells and 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 throws away a bare NULL very
> early in the process, so it is not available to consult at the point that
> PostgreSQL is creating the 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 for taking the pains.
> Since it's not, it's not clear that doing the work to add the warning is
> worth the effort.
>
Such a warning *could* be put in psql*, but is the effort worth the
benefit? I don't really think OP's scenario is very common.
*People using pgAdmin, pgcli, etc wouldn't see the warning.
From | Date | Subject | |
---|---|---|---|
Next Message | Justin Clift | 2024-03-25 23:43:00 | Re: PostgreSQL as advanced job queuing system |
Previous Message | Nathan Bossart | 2024-03-25 15:16:47 | Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs |