pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hannu Krosing <hannu@trust.ee>
To: Mark Nielsen <psql@www.tcu-inc.com>
Cc: interface <pgsql-interfaces@postgreSQL.org>
Subject: Re: [INTERFACES] creatng a new interface to postgresql, how do I update a field with a particular oid?
Date: Mon, 03 Aug 1998 18:03:36 +0300
Message-ID: <35C5D148.3BD95CE5@trust.ee> (raw)
References: <199808030152.VAA24510@www.tcu-inc.com>

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



view thread (2+ messages)

Message-ID: <35C5D148.3BD95CE5@trust.ee>
Permalink:  ../35C5D148.3BD95CE5@trust.ee/
Also on:    postgresql.org/message-id/35C5D148.3BD95CE5@trust.ee

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: hannu@trust.ee, psql@www.tcu-inc.com
  Subject: Re: [INTERFACES] creatng a new interface to postgresql, how do I update a field with a particular oid?
  In-Reply-To: <35C5D148.3BD95CE5@trust.ee>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox