| От | Tom Lane |
|---|---|
| Тема | Re: Re: Date of creation and of change |
| Дата | |
| Msg-id | 2205.967212888@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Date of creation and of change (Andreas Tille <tillea@rki.de>) |
| Ответы |
Re: Date of creation and of change
|
| Список | pgsql-sql |
Andreas Tille <tillea@rki.de> writes:
>> NEW.ChangedAt := timestamp(''now'');
> This avoids the error message, but doesn't have any effect to the value
> of ChangedAt. It just remains the same as CreatedAt :-(.
I think you are getting burnt by premature constant folding --- see
nearby discussion of how to define a column default that gives the
time of insertion. You need to write this asNEW.ChangedAt := now();
to prevent the system from reducing timestamp('now') to a constant
when the function is first executed.
regards, tom lane
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера