Extend libpq to support mixed text and binary results - Mailing list pgsql-hackers

From Albe Laurenz
Subject Extend libpq to support mixed text and binary results
Date
Msg-id D960CB61B694CF459DCFB4B0128514C208A4EDD4@exadv11.host.magwien.gv.at
Whole thread Raw
Responses Re: Extend libpq to support mixed text and binary results  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Extend libpq to support mixed text and binary results  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
The Frontend/Backend protocol's "bind" message allows to
specify mixed text and binary result formats, but there
is not support in the C API for that.

I'd like to add support for that to libpq for these reasons:

- I think that every feature of the line protocol should
  be exposed in the C API.

- This is quite useful if you select bytea and other
  fields in one query (less overhead and data traffic
  for the bytea).

- I've seen at least one case on the list where
  somebody would have liked to have that feature:
  http://archives.postgresql.org/pgsql-general/2012-08/msg00761.php

Attached is a WIP patch that adds four new functions
to libpq:
PQexecParams2
PQexecPrepared2
PQsendQueryParams2
PQsendQueryPrepared2

If that idea meets with approval, I'd add documentation and
submit it to the next commitfest.

I am aware that these names are rather ugly and welcome
better ideas.

Maybe it is not necessary to add four new functions.
You could get the full functionality just with
PQsendQueryPrepared2, the rest is just for ease of use.

Yours,
Laurenz Albe

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: WIP patch for hint bit i/o mitigation
Next
From: Atri Sharma
Date:
Subject: Re: WIP patch for hint bit i/o mitigation