Re: Column default

Поиск
Список
Период
Сортировка
От Jeff Eckermann
Тема Re: Column default
Дата
Msg-id 20050215145446.87208.qmail@web20827.mail.yahoo.com
обсуждение исходный текст
Ответ на Re: Column default  ("Keith Worthington" <keithw@narrowpathinc.com>)
Список pgsql-novice
--- Keith Worthington <keithw@narrowpathinc.com>
wrote:

>Why aren't the defaults applied when data arrives
>that is an update?

The updated row will consist of all of the previous
column values, except for those which your update
statement has explicitly changed.

>What is
>the elegant way to ensure that if records are
>updated with missing
>information
>the defaults are applied?

With a trigger.  Since you are doing your processing
via a trigger anyway, you could just put your data
validation logic right there in the function.

>
>Why aren't the defaults applied when data arrives
>that is an insert?

They are.  Your last message did not show any evidence
that that was not happening.

>What is
>the elegant way to ensure that if records are
>inserted with missing
>information the defaults are applied?

As above.





__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail

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

Предыдущее
От: "Mike G."
Дата:
Сообщение: Re: Question on PL/Perl
Следующее
От:
Дата:
Сообщение: Revision Control