| От | Tom Lane |
|---|---|
| Тема | Re: Modifying NOT NULL Constraint |
| Дата | |
| Msg-id | 11373.960957195@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Modifying NOT NULL Constraint ("Dan Wilson" <phpPgAdmin@acucore.com>) |
| Список | pgsql-hackers |
"Dan Wilson" <phpPgAdmin@acucore.com> writes:
> this was posed as a solutions to modifying the NOT NULL constraint:
>> update pg_attributes set attnotnull = 'f' where oid = oidofnotnullcolumn;
>> vacuum analyze;
attnotnull is where the gold is hidden, all right. The 'vacuum analyze'
step is mere mumbo-jumbo --- there's no need for that.
> Are there any side effects of which I should be aware before attempting to
> use this?
Changing in that direction should be safe enough. Turning attnotnull
*on* is a little more dubious, since it won't magically make any
existing null entries in the column go away. attnotnull just governs
the check that prevents you from storing new nulls.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера