Re: cataloguing NOT NULL constraints
От | Alexander Lakhin |
---|---|
Тема | Re: cataloguing NOT NULL constraints |
Дата | |
Msg-id | 7d0f1fea-0f1a-2c9f-9b02-867b73abee78@gmail.com обсуждение исходный текст |
Ответ на | Re: cataloguing NOT NULL constraints (Alvaro Herrera <alvherre@alvh.no-ip.org>) |
Список | pgsql-hackers |
02.05.2024 19:21, Alvaro Herrera wrote: > Now, you could claim that the standard doesn't mention > INCLUDING/EXCLUDING CONSTRAINTS, therefore since we have come up with > its definition then we should make it affect not-null constraints. > However, there's also this note: > > NOTE 520 — <column constraint>s, except for NOT NULL, are not included in > CDi; <column constraint definition>s are effectively transformed to <table > constraint definition>s and are thereby also excluded. > > which is explicitly saying that not-null constraints are treated > differently; in essence, with INCLUDING CONSTRAINTS we choose to affect > the constraints that the standard says to ignore. Thank you for very detailed and convincing explanation! Now I see what the last sentence here (from [1]) means: INCLUDING CONSTRAINTS CHECK constraints will be copied. No distinction is made between column constraints and table constraints. _Not-null constraints are always copied to the new table._ (I hadn't paid enough attention to it, because this exact paragraph is also presented in previous versions...) [1] https://www.postgresql.org/docs/devel/sql-createtable.html Best regards, Alexander
В списке pgsql-hackers по дате отправления: