Returning old value on update

From: Gerhard Heift <ml-postgresql-20081012-3518(at)gheift(dot)de>
To: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Returning old value on update
Date: 2009-01-31 13:03:12
Message-ID: 20090131130312.GA3728@gheift
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

is it possible to get the old value of an update, something like this:

INSERT INTO my_table (col) VALUES (2);

UPDATE my_table SET col = 4 RETURNING old.col;

Should give me the 2.

Regards,
Gerhard

Browse pgsql-general by date

  From Date Subject
Next Message Luis Neves 2009-01-31 13:39:20 Re: Pet Peeves?
Previous Message Roger Leigh 2009-01-31 12:38:18 Re: Pet Peeves?