Re: [INTERFACES] creatng a new interface to postgresql, how do I update a field with a particular oid?

From: Hannu Krosing <hannu(at)trust(dot)ee>
To: Mark Nielsen <psql(at)www(dot)tcu-inc(dot)com>
Cc: interface <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] creatng a new interface to postgresql, how do I update a field with a particular oid?
Date: 1998-08-03 15:03:36
Message-ID: 35C5D148.3BD95CE5@trust.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Kapoor, Nishikant X 1998-08-03 19:16:20 How to set java.sql.Date to null ?
Previous Message Maarten Boekhold 1998-08-03 06:40:03 Re: [INTERFACES] Re: [HACKERS] User authentication bug?