Re: Setting a field to default if blank value

Поиск
Список
Период
Сортировка
От Dennis Gearon
Тема Re: Setting a field to default if blank value
Дата
Msg-id 3EADB3AA.1030905@cvc.net
обсуждение исходный текст
Ответ на Setting a field to default if blank value  ("Robert Fitzpatrick" <robert@webtent.com>)
Список pgsql-general
did you try what I gave you? It should have puked when you tried to insert a blank field.

Robert Fitzpatrick wrote:
> 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>


В списке pgsql-general по дате отправления:

Предыдущее
От: Dennis Gearon
Дата:
Сообщение: Re: Fwd: Re: Selecting the most recent date
Следующее
От: Tom Lane
Дата:
Сообщение: Re: timestamps and dates