| От | Ian Barwick |
|---|---|
| Тема | Re: Why is default value not working on insert? |
| Дата | |
| Msg-id | 1d581afe0608081353t15a37126l2d8ecf2fcba2b247@mail.gmail.com обсуждение исходный текст |
| Ответ на | Why is default value not working on insert? ("Chris Hoover" <revoohc@gmail.com>) |
| Список | pgsql-general |
2006/8/8, Chris Hoover <revoohc@gmail.com>: (...) > The reason for the null being passed to to_date is this is on of almot 90k > lines of data we are trying to load, and the script was built to generate > this code. Since to_date(null,'yyyymmdd') returns a null, why is the > default not working? Because you're trying to explicitly insert a NULL into a column which is specified as NOT NULL. (If you can't change the script to output DEFAULT or the explicit default value, the best workaraound would be to create a trigger which converts any attempt to insert a NULL value into that column to the intended default value). Ian Barwick
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера