Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group