| От | Robert Fitzpatrick |
|---|---|
| Тема | Setting a field to default if blank value |
| Дата | |
| Msg-id | 000d01c30da9$66be2f80$0b01a8c0@columbus обсуждение исходный текст |
| Ответы |
Re: Setting a field to default if blank value
Re: Setting a field to default if blank value |
| Список | pgsql-general |
Looking for the best way of handling this, would like to do it in the database and not in my apps. I set a field to 'Not Null', but if a blank value comes in, the field will accept it as just that, a blank string. How can avoid this using a trigger or function? I thought about a function that would check the field and then place a trigger, but that gets to be a lot of functions and triggers for different fields. Is there a way to pass a field name to the function? (in plpgsql) Or what is the best way to handle this for many different fields in many tables? -- Robert
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера