Re: pg17 issues with not-null contraints

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: pg17 issues with not-null contraints
Дата
Msg-id ZjTvH99NPNF1QY6n@pryzbyj2023
обсуждение исходный текст
Ответ на Re: pg17 issues with not-null contraints  (Justin Pryzby <pryzby@telsasoft.com>)
Ответы Re: pg17 issues with not-null contraints
Список pgsql-hackers
On another thread [0], Alexander Lakhin pointed out, indirectly, that
partitions created using LIKE+ATTACH now have different not-null constraints
from partitions created using PARTITION OF.

postgres=# CREATE TABLE t (i int PRIMARY KEY) PARTITION BY RANGE (i);
postgres=# CREATE TABLE t1 PARTITION OF t DEFAULT ;
postgres=# \d+ t1
...
Partition of: t DEFAULT
No partition constraint
Indexes:
    "t1_pkey" PRIMARY KEY, btree (i)
Access method: heap

But if it's created with LIKE:
postgres=# CREATE TABLE t1 (LIKE t);
postgres=# ALTER TABLE t ATTACH PARTITION t1 DEFAULT ;

..one also sees:

Not-null constraints:
    "t1_i_not_null" NOT NULL "i"

It looks like ATTACH may have an issue with constraints implied by pkey.

[0] https://www.postgresql.org/message-id/8034d1c6-5f0e-e858-9af9-45d5e246515e%40gmail.com

-- 
Justin



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Document NULL
Следующее
От: Jacob Champion
Дата:
Сообщение: Re: [PATCH] json_lex_string: don't overread on bad UTF8