| От | Alvaro Herrera |
|---|---|
| Тема | Re: not null constraints, again |
| Дата | |
| Msg-id | 202504161124.4ypvhzbnecbm@alvherre.pgsql обсуждение |
| Ответ на | Re: not null constraints, again (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: not null constraints, again
Re: not null constraints, again |
| Список | pgsql-hackers |
Here's another version where I do skip searching for children twice, and rewrote the comments. I also noticed that in child tables we were only looking for pg_attribute.attnotnull, and not whether the constraints had been validated or made inheritable. This seemed a wasted opportunity, so I refactored the code to instead examine the pg_constraint row and apply the same checks as for the constraint on the parent (namely, that it's valid and not NO INHERIT). We already check for these things downstream (alter table phase 2, during AdjustNotNullInheritance), but only after potentially wasting more work, so it makes sense to do it here (alter table phase 1) given that it's very easy. I added some tests for these things also, as those cases weren't covered. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "¿Cómo puedes confiar en algo que pagas y que no ves, y no confiar en algo que te dan y te lo muestran?" (Germán Poo)
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера