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

From Laurenz Albe
Subject Re: Is this a buggy behavior?
Date
Msg-id 1b43161b9e7223f77227b7a297dad6de344acdc5.camel@cybertec.at
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?  (Thiemo Kellner <thiemo@gelassene-pferde.biz>)
List 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



pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Not able to purge partition
Next
From: "Bandi, Venkataramana - Dell Team"
Date:
Subject: RE: Query on Postgres SQL transaction