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

Re: pg_select Equivalent in libpq

From: Antonio Sergio de Mello e Souza <asergioz(at)bol(dot)com(dot)br>
To: Christof Petig <christof(at)petig-baender(dot)de>
Cc: Ecmel Ercan <ecmel(at)linux-turkey(dot)com>, PostgreSQL <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: pg_select Equivalent in libpq
Date: 2001-09-19 13:31:49
Message-ID: 3BA89E45.C983ABB3@bol.com.br (view raw or flat)
Thread:
Lists: pgsql-interfaces
Christof Petig wrote:

> Ecmel Ercan wrote:
>
> > At some point, I need to process each tuple returned by the PQexec
> > SELECT query as soon as it is received.  (Actually I like to insert them
> > in a table widget).
> >
> > But when I execute PQExec, all the SELECT result is fetched first.  I
> > have a very big table so I need to insert each row as soon as they are
> > fetched from the server.
> >
> > The pg_select function does this but it is in TCL library.
> >
> > How can I achive the same result in libpq?
>
> I would recommend a cursor. But I don't know how to do that in pq (only
> with ecpg)
>

See Example 1-3 in the libpq documentation:

/*
 * testlibpq3.c Test the C version of Libpq, the Postgres frontend
 * library. tests the binary cursor interface
 *
 *
...

Regards,

Antonio Sergio



In response to

pgsql-interfaces by date

Next:From: Arsalan ZaidiDate: 2001-09-20 07:35:51
Subject: 90 million rows in one table...
Previous:From: Michael MeskesDate: 2001-09-19 06:43:14
Subject: Re: pg_select Equivalent in libpq

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