Re: Proposed new libpq API

From: The Hermit Hacker <scrappy(at)hub(dot)org>
To: Chris Bitmead <chris(at)bitmead(dot)com>
Cc: Chris Bitmead <chrisb(at)nimrod(dot)itg(dot)telstra(dot)com(dot)au>, "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers-oo(at)postgresql(dot)org
Subject: Re: Proposed new libpq API
Date: 2000-07-05 14:09:29
Message-ID: Pine.BSF.4.21.0007051106420.33627-100000@thelab.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 5 Jul 2000, Chris Bitmead wrote:

> The Hermit Hacker wrote:
> >
> > Okay, first thing off the top of my head ... how does this deal with
> > backward compatibility, or have we just blown all old apps out to fhte
> > water?
>
> There's no issue with compatibility, unless you can see one. It's all
> backwards compatible.

Okay, I'm definitely missing something then ...

> > > Currently you might read results like this...
> > >
> > > PGresult *res = PQexec("select * from foo");
> > > for (int i = 0; i < PQntuples(res); i++) {
> > > printf("%s\n", PQgetValue(res, i, 0);
> > > }
> > >
> > > It has the disadvantage that all the results are kept in memory at
> > > once. This code would in the future be modified to be...
> > >
> > > PGresult *res = PQexec("select * from foo");
> > > for (int i = 0; i < PQntuples(res); i++) {
> > > printf("%s\n", PQgetValue(res, i, 0);
> > > PQflush(res) // NEW NEW
> > > }
> > >

What is the PQflush() for here? I took it to mean that it was required,
but then reading further down, it just sounds like it flushs what's
already been used and would be optional?

Doesn't this just do what CURSORs already do then? Run the query, fetch
what you need, etc?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2000-07-05 14:21:40 Re: Per-database/schema settings
Previous Message Philip Warner 2000-07-05 13:58:28 pg_dump and LOs (another proposal)