Re: pg17 issues with not-null contraints
От | Alvaro Herrera |
---|---|
Тема | Re: pg17 issues with not-null contraints |
Дата | |
Msg-id | 202405040920.2rg4mmjgv3ch@alvherre.pgsql обсуждение исходный текст |
Ответ на | Re: pg17 issues with not-null contraints (Justin Pryzby <pryzby@telsasoft.com>) |
Ответы |
Re: pg17 issues with not-null contraints
|
Список | pgsql-hackers |
On 2024-May-03, Justin Pryzby wrote: > 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" Hmm, I think the problem here is not ATTACH; the not-null constraint is there immediately after CREATE. I think this is all right actually, because we derive a not-null constraint from the primary key and this is definitely intentional. But I also think that if you do CREATE TABLE t1 (LIKE t INCLUDING CONSTRAINTS) then you should get only the primary key and no separate not-null constraint. That will make the table more similar to the one being copied. Does that make sense to you? -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Estoy de acuerdo contigo en que la verdad absoluta no existe... El problema es que la mentira sí existe y tu estás mintiendo" (G. Lama)
В списке pgsql-hackers по дате отправления: