Re: Select for update - Mailing list pgsql-general

From Richard Huxton
Subject Re: Select for update
Date
Msg-id 42E8C2A5.60700@archonet.com
Whole thread Raw
In response to Select for update  (Havasvölgyi Ottó <h.otto@freemail.hu>)
List pgsql-general
Havasvölgyi Ottó wrote:
> Hi,
>
> Is it normal that when I select for update a record, but I don't select
> all the fields, that the contents of fields not selected will be deleted:
>
> create table pidtest(pid integer, szoveg text) without oids;
>
> select pid from pistest where pid>5 for update;
>
> After committing (autocommit), the contents of the szoveg field for the
> locked rows will be erased.

Committing what? You're not updating anything here. The "SELECT...FOR
UPDATE" just locks the rows so you can update them, it doesn't perform
the update.

--
   Richard Huxton
   Archonet Ltd


pgsql-general by date:

Previous
From: Havasvölgyi Ottó
Date:
Subject: Select for update
Next
From: Michael Fuhr
Date:
Subject: Re: Select for update