> UPDATE members m,payments p SET m.status = 2
> WHERE p.paydate > 'now'::datetime - '1 month'::timespan
> and p.productid = 'xxxxxxx' and m.gid = p.gid
Try
UPDATE members set status = 2
FROM payments p
WHERE p.paydate > timestamp 'now' - interval '1 month'
AND p.productid = 'xxxxxxx' and members.gid = p.gid;