Re: Null vs. Empty String in Postgres 8.3.8

Поиск
Список
Период
Сортировка
От CaT
Тема Re: Null vs. Empty String in Postgres 8.3.8
Дата
Msg-id 20100405032806.GZ2657@zip.com.au
обсуждение исходный текст
Ответ на Re: Null vs. Empty String in Postgres 8.3.8  ("Wang, Mary Y" <mary.y.wang@boeing.com>)
Список pgsql-general
On Sun, Apr 04, 2010 at 08:03:13PM -0700, Wang, Mary Y wrote:
> I still don't get it.  I do want a zero for the subversion_flags to be stored in the table.  But it returned an error
becauseit didn't like subversion_flags='' in the UPDATE SQL statement.   
>
> subversion_flags | integer       | not null default 0

Thde default will not apply because you attempted to input a value.
Unless I'm mistaken the provision of any value (erroneous or otherwise)
obviates the activation of the default value. There is an exception
to this and that is using the DEFAULT keyword (ie subversion_flags=DEFAULT).

Otherwise the only way it activates is if you leave subversion_flags out
totally.

If you want input data mangling then a TRIGGER may be the way to go.

--
  "A search of his car uncovered pornography, a homemade sex aid, women's
  stockings and a Jack Russell terrier."
    - http://www.news.com.au/story/0%2C27574%2C24675808-421%2C00.html

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

Предыдущее
От: Peter Hunsberger
Дата:
Сообщение: Re: Null vs. Empty String in Postgres 8.3.8
Следующее
От: Sreelatha G
Дата:
Сообщение: Re: Dynamic plpgsql help