Re: [GENERAL] Adding 1 week to a timestamp, which can be NULL or expired

2011-11-20 Thread John R Pierce
On 11/20/11 2:32 AM, Alexander Farber wrote: update pref_users set vip = max(vip, now()) + interval '1 week'; but max() doesn't work with timestamps. max works fine with timestamps... however, its a 1 argument function that takes an aggregate as its argument. you perhaps want GREATEST(v

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

2011-11-20 Thread Alexander Farber
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 -- Sent via pgsql-general mailing list (pg