pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedRetrieve rows 1 by 1
3+ messages / 3 participants
[nested] [flat]
* Retrieve rows 1 by 1
@ 1999-03-10 03:42 Vikrant Rathore <vikrant@chemquick.com>
1999-03-10 08:00 ` Re: [INTERFACES] Retrieve rows 1 by 1 Hannu Krosing <hannu@trust.ee>
1999-03-10 13:17 ` Re: [INTERFACES] Retrieve rows 1 by 1 James Olin Oden <joden@lee.k12.nc.us>
0 siblings, 2 replies; 3+ messages in thread
From: Vikrant Rathore @ 1999-03-10 03:42 UTC (permalink / raw)
To: pgsql-interfaces
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [INTERFACES] Retrieve rows 1 by 1
1999-03-10 03:42 Retrieve rows 1 by 1 Vikrant Rathore <vikrant@chemquick.com>
@ 1999-03-10 08:00 ` Hannu Krosing <hannu@trust.ee>
1 sibling, 0 replies; 3+ messages in thread
From: Hannu Krosing @ 1999-03-10 08:00 UTC (permalink / raw)
To: vikrant@neuronetin.com; +Cc: 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.
each row has an unique 'object identifier' field called oid (that is
returned by a single-row insert if you use the psql interface)
so you can use where oid=NNNNN as qualification
Hannu
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [INTERFACES] Retrieve rows 1 by 1
1999-03-10 03:42 Retrieve rows 1 by 1 Vikrant Rathore <vikrant@chemquick.com>
@ 1999-03-10 13:17 ` James Olin Oden <joden@lee.k12.nc.us>
1 sibling, 0 replies; 3+ messages in thread
From: James Olin Oden @ 1999-03-10 13:17 UTC (permalink / raw)
To: vikrant@neuronetin.com; +Cc: 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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~1999-03-10 13:17 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-03-10 03:42 Retrieve rows 1 by 1 Vikrant Rathore <vikrant@chemquick.com>
1999-03-10 08:00 ` Hannu Krosing <hannu@trust.ee>
1999-03-10 13:17 ` James Olin Oden <joden@lee.k12.nc.us>
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