Re: Touch row ?

Поиск
Список
Период
Сортировка
От Eric Ridge
Тема Re: Touch row ?
Дата
Msg-id FB6F1D8E-4EB2-11D8-8446-000A95BB5944@tcdi.com
обсуждение исходный текст
Ответ на Re: Touch row ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Jan 24, 2004, at 3:58 PM, Tom Lane wrote:

> 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.

Maybe the rule is that the computed value is always used, unless:
    UPDATE foo OVERRIDE DEFAULTS set d=yesterday();

*shrug*.  At least with something like the above, the user makes his
intention explicit.  Perhaps if user doesn't specify OVERRIDE DEFAULTS,
postgres outputs a warning:
    WARNING:  value for column 'd' ignored.
    HINT:  Use UPDATE ... OVERRIDE DEFAULTS to override ON UPDATE DEFAULT
values

and of course, this would be handy too:
    UPDATE foo OVERRIDE DEFAULTS set d=DEFAULT;

eric


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Touch row ?
Следующее
От: "Lee Harr"
Дата:
Сообщение: Re: pl/pgsql docs 37.4.3. Row Types -- how do I use this function?