Re: get value after updating table - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: get value after updating table
Date
Msg-id 20070326210012.GB28954@svana.org
Whole thread Raw
In response to get value after updating table  ("Alain Roger" <raf.news@gmail.com>)
List pgsql-general
On Mon, Mar 26, 2007 at 09:38:07PM +0200, Alain Roger wrote:
> Hi,
>
> I wrote a function which should update a table field.
> However, i would like somehow to control that update was done.
> for that i was thinking to return a boolean : true is update was done, false
> if an error happened.

I beleive in recent versions you can do things like:
>    UPDATE accounts
>    SET account_pwd = $2
>    WHERE account_login = $1
RETURNING account_id;

If it updated it would return the ID of the row updated...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Ron
Date:
Subject: A (hopefully) simple question re: secure pg <=> web application access
Next
From: "Martin Gainty"
Date:
Subject: Re: A (hopefully) simple question re: secure pg <=> web application access