Re: Is this a buggy behavior?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Is this a buggy behavior?
Дата
Msg-id CAKFQuwaXqV2nOVjcQxbuur1er0dhVwbgnGNd2GV16QJGP0cwSA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Is this a buggy behavior?  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Ответы Re: Is this a buggy behavior?
Список pgsql-general
On Sun, Mar 24, 2024 at 11:14 AM Peter J. Holzer <hjp-pgsql@hjp.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.

В списке pgsql-general по дате отправления:

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Is this a buggy behavior?
Следующее
От: Erik Wienhold
Дата:
Сообщение: Re: Empty materialized view