Adding 1 week to a timestamp, which can be NULL or expired

Поиск
Список
Период
Сортировка
От Alexander Farber
Тема Adding 1 week to a timestamp, which can be NULL or expired
Дата
Msg-id CAADeyWgPPb4Z2kWSgG1xxKjsCk0znxpDjZsdY1OVDjPw+8LD-Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: Adding 1 week to a timestamp, which can be NULL or expired  (John R Pierce <pierce@hogranch.com>)
Список pgsql-general
Hello,

I'm trying to add 1 week "VIP-status" to all users in a table:

   update pref_users set vip = max(vip, now()) + interval '1 week';

but max() doesn't work with timestamps.

Is there maybe still a way to solve it with a one-liner?

Thank you
Alex

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

Предыдущее
От: Phoenix Kiula
Дата:
Сообщение: Re: Installed. Now what?
Следующее
От: John R Pierce
Дата:
Сообщение: Re: Adding 1 week to a timestamp, which can be NULL or expired