Re: [PATCHES] libpq type system 0.9a - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] libpq type system 0.9a
Date
Msg-id 5204.1207849253@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] libpq type system 0.9a  (Andrew Chernow <ac@esilo.com>)
Responses Re: [PATCHES] libpq type system 0.9a  (Andrew Chernow <ac@esilo.com>)
List pgsql-hackers
Andrew Chernow <ac@esilo.com> writes:
> PGresult *PQresultDup(
>    PGconn *conn,
>    PGresult *res,
>    int ntups,
>    int numAttributes,
>    PGresAttDesc *attDescs);

I don't understand why this is a "dup" operation.  How can you "dup"
if you are specifying a new tuple descriptor?  I'd have expected
something like

PGresult *PQmakeResult(PGconn *conn, int numAttributes, PGresAttDesc *attDescs)

producing a zero-row PGRES_TUPLES_OK result that you can then load with
data via PQresultSetFieldValue calls.  (Even the conn argument is a bit
of a wart, but I think we probably need it so we can copy some of its
private fields.)

Copying an existing PGresult might have some use too, but surely that
can't change its tuple descriptor.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Chernow
Date:
Subject: Re: [PATCHES] libpq type system 0.9a
Next
From: Teodor Sigaev
Date:
Subject: Re: Index AM change proposals, redux