Re: Touch row ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Touch row ?
Дата
Msg-id 4636.1074977894@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Touch row ?  (Eric Ridge <ebr@tcdi.com>)
Ответы Re: Touch row ?  (Eric Ridge <ebr@tcdi.com>)
Список pgsql-general
Eric Ridge <ebr@tcdi.com> writes:
> On Jan 24, 2004, at 2:34 PM, Tom Lane wrote:
>> A different tack that might be interesting to think about is to invent
>> a notion of an "update default" for a column, analogous to the existing
>> "insert default".

> This thought ran through my head last night.  Something like:

> CREATE TABLE foo (
>     id int4 DEFAULT nextval('foo_seq'),
>           d timestamp DEFAULT now() ON UPDATE now()
> );

> But it seems that if the user explicitly provided a value for 'd',
> you'd want to use that over the computed value.

True.  So if your goal is to force the timestamp column to be the
correct value even when the user tries to set it to something else,
you'd still have to use a trigger or rule.

            regards, tom lane

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

Предыдущее
От: Eric Ridge
Дата:
Сообщение: Re: Touch row ?
Следующее
От: Eric Ridge
Дата:
Сообщение: Re: Touch row ?