Mark Nielsen wrote:
>
> Hello!
>
>
> Anyways, my question is, I want to update specific rows according to their
> oids. Oh, I am also using the perl module Pg. I can find out the oid of
> the data retrieved, but I want to update data according to their oid.
update my_table
set
field1 = value1,
field2 = value2
where
oid = my_oid
;
to make it faster you can create an index on the oid column.
It used to require a cast for pg to use the index, i.e.
where oid = const_oid::oid
but I don't know if it is still the case.
postgresql does not yet have a "select for update" syntax or
mechanics implemented.
----------
Hannu