From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: Is this a buggy behavior? |
Date: | 2024-03-24 18:23:22 |
Message-ID: | CAKFQuwaXqV2nOVjcQxbuur1er0dhVwbgnGNd2GV16QJGP0cwSA@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Sun, Mar 24, 2024 at 11:14 AM Peter J. Holzer <hjp-pgsql(at)hjp(dot)at> wrote:
>
> It doesn't. Your statement
>
> > CREATE TABLE test1
> > (
> > c1 numeric NULL ,
> > c2 varchar(36) NOT NULL ,
> > CONSTRAINT test1_PK PRIMARY KEY (c1,c2)
> > ) ;
>
> creates the table with both columns being defined as NOT NULL:
>
>
The request is a warning when defining a multi-column table
constraint primary key if any of the columns comprising said PK are not
defined already to be NOT NULL.
Personally, green field at least, I find that to be reasonable. Especially
if we are altering catalog metadata to define the columns to be not null,
as opposed to say the case when a check constraint has a "col is not null"
condition that could never pass even though the column itself is null-able.
David J.
From | Date | Subject | |
---|---|---|---|
Next Message | Erik Wienhold | 2024-03-24 19:56:11 | Re: Empty materialized view |
Previous Message | Peter J. Holzer | 2024-03-24 18:14:07 | Re: Is this a buggy behavior? |