Search Postgresql Archives

Re: Is this a buggy behavior?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 24, 2024 at 11:14 AM Peter J. Holzer <hjp-pgsql@xxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux