Search Postgresql Archives

Re: Select for update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux