Re: pgplsql SELECT INTO ... FOR UPDATE - Mailing list pgsql-general

From Ragnar Hafstað
Subject Re: pgplsql SELECT INTO ... FOR UPDATE
Date
Msg-id 1103114093.4086.4.camel@localhost.localdomain
Whole thread Raw
In response to pgplsql SELECT INTO ... FOR UPDATE (transaction/locking question)  (Eric Brown <eric.brown@propel.com>)
List pgsql-general
On Wed, 2004-12-15 at 01:38 -0800, Eric Brown wrote:
>
>
> ______________________________________________________________________
>
> I'm trying to write a stored procedure in plpgsql that selects a row
> and possibly increments one of its fields. I thought I would do SELECT
> INTO my_record * FROM my_table FOR UPDATE WHERE ..., but apparently
> plpgsql doesn't like the FOR UPDATE in a stored procedure.

the docs seem to imply that the FOR UPDATE clause should follow the
WHERE clause.
and indeed, it would seem that your should follow the '*'
try
SELECT * INTO my_record WHERE ... FOR UPDATE

gnari



pgsql-general by date:

Previous
From: Daniel Martini
Date:
Subject: Re: Connect to Postgres 7.4 via ODBC
Next
From: "Berend Tober"
Date:
Subject: Re: pgplsql SELECT INTO ... FOR UPDATE