Re: [INTERFACES] Retrieve rows 1 by 1

From: James Olin Oden <joden(at)lee(dot)k12(dot)nc(dot)us>
To: vikrant(at)neuronetin(dot)com
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] Retrieve rows 1 by 1
Date: 1999-03-10 13:17:30
Message-ID: 36E670EA.749A3E26@lee.k12.nc.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Vikrant Rathore wrote:

> Please any one can tell me how to update,insert or change a single row
> using libpq interface. The table is not indexed and do not have a
> primary key.
> Can any one give me a way to retrieve,chage or insert data after any
> row.
> Thanks in advance
> Vikrant

I am not familiar enough with libq to give you the specifics, but I think
the key is to realize that though you do not have primary key, every
object in a table has an oid (Object ID) that postgress assigns it that is
unique. So when you do a select be sure to include the oid field, and
then you can update that specific record easily by specifying that"

oid = ####

That is whatever number you pulled from the database with your select. As
for the specifics the various docs on the website I believe describe the
libq interface very well (I just have never used it so I don't remember
it) so that you can fill in the specifics for yourself.

...james

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 1999-03-10 15:00:23 Re: [INTERFACES] perl-interface: make test
Previous Message Stuart Rison 1999-03-10 11:38:39 Re: [GENERAL] Re: [INTERFACES] the last row in a table