| From: | Richard Huxton <dev(at)archonet(dot)com> |
|---|---|
| To: | Havasvölgyi Ottó <h(dot)otto(at)freemail(dot)hu> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Select for update |
| Date: | 2005-07-28 11:33:57 |
| Message-ID: | 42E8C2A5.60700@archonet.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Fuhr | 2005-07-28 12:02:24 | Re: Select for update |
| Previous Message | Havasvölgyi Ottó | 2005-07-28 11:22:31 | Select for update |