Re: Is this a buggy behavior?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Thiemo Kellner <thiemo(at)gelassene-pferde(dot)biz>, "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 06:59:19
Message-ID: 1b43161b9e7223f77227b7a297dad6de344acdc5.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 2024-03-24 at 17:32 +0100, Thiemo Kellner wrote:
> > The reason it doesn't give you a warning is that by the time it would
> > be in a position to, it's forgotten that you explicitly said NULL.
>
> How can that be forgotten? This information ends up in the data
> catalogue eventually!

It *is* stored in the catalog.

But if you add a primary key, that is tantamount to saying

ALTER TABLE tab ALTER col SET NOT NULL;

So it overrides the definition you made before.

Or would you want the above statement to cause an error just
because somebody had defined the column nullable before?

Perhaps you'd want that, but you are one of the few who do.
You'll have to get used to the way it is.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bandi, Venkataramana - Dell Team 2024-03-25 07:18:56 RE: Query on Postgres SQL transaction
Previous Message Laurenz Albe 2024-03-25 06:52:51 Re: Not able to purge partition