Re: cataloguing NOT NULL constraints - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: cataloguing NOT NULL constraints
Date
Msg-id 992af0a9-86ee-ecd0-2e12-ed66a1b100dd@eisentraut.org
Whole thread Raw
In response to Re: cataloguing NOT NULL constraints  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On 24.07.23 12:32, Alvaro Herrera wrote:
> However, 11.16 (<drop column not null clause> as part of 11.12 <alter
> column definition>), says that DROP NOT NULL causes the indication of
> the column as NOT NULL to be removed.  This, to me, says that if you do
> have multiple such constraints, you'd better remove them all with that
> command.  All in all, I lean towards allowing just one as best as we
> can.

Another clue is in 11.15 <set column not null clause>, which says

     1) Let C be the column identified by the <column name> CN in the
     containing <alter column definition>. If the column descriptor of C
     does not contain an indication that C is defined as NOT NULL, then:

     [do things]

Otherwise it does nothing.  So there can only be one such constraint per 
table.




pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: [PoC] pg_upgrade: allow to upgrade publisher node
Next
From: Bharath Rupireddy
Date:
Subject: Re: add timing information to pg_upgrade