On Wed, Mar 29, 2023 at 11:04 AM Jeff Davis <pgsql@j-davis.com> wrote:
I'm not clear on what proposal you are making and/or endorsing?
ha -- was just backing up dave's GUC idea.
1. Fix our own clients, like psql, to check for binary data they can't process.
This ought to be impossible IMO. All libpq routines except PQexec have an explicit expectation on format (via resultformat parameter) that should not be overridden. PQexec ought to be explicitly documented and wired to only request text format data.
resultfomat can be extended now or later to allow participating clients to receive GUC configured format. I do not think that libpq's result format being able to be overridden by GUC is a good idea at all, the library has to to participate, and I think can be made to so so without adjusting the interface (say, by resultFormat = 3). Similarly, in JDBC world, it ought to be up to the driver to determine when it want the server to flex wire formats but must be able to override the server's decision.