libpq

From: Chris <chris(at)bitmead(dot)com>
To: Postgres Hackers List <hackers(at)postgreSQL(dot)org>
Subject: libpq
Date: 2000-02-10 12:24:32
Message-ID: 38A2AE00.9EB1BE9B@bitmead.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I've been poking around in the libpq area and I'm thinking of tackling
the streaming interface which was suggested recently.

What I have in mind is that a new API PQexecStream() doesn't retrieve
the results. The tuples are then read back one by one with
PQnextObject(). You can also use PQnextObject with regular PQexec, but
in that case you lose the most of the benefit of streaming because it
would allocate memory for all the result. So the proposal is...

/* like PQexec, but streams the results */
PGresult *PQexecStream(PGconn *conn, const char *query)
/* retrieve the next object from a PGresult */
PGobject *PQnextObject(PGconn *conn)
/* get value from an object/tuple */
char *PQgetObjectValue(const PGobject *res, int field_num)
/* free tuple when done */
void PQclearObject(PGobject *obj)

Oh yeah, can I fix the COPY protocol while I'm at it to conform more to
the other types of messages?

BTW, what is this PQ thing? Does it stand for postquel? Are we ever
going to dump that?

--
Chris Bitmead
mailto:chris(at)bitmead(dot)com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas SB 2000-02-10 12:35:22 AW: AW: [HACKERS] Another nasty cache problem
Previous Message Hannu Krosing 2000-02-10 11:41:13 Re: [HACKERS] minor bug...