Re: Proposal to provide the facility to set binary format output for specific OID's per session - Mailing list pgsql-hackers

From Dave Cramer
Subject Re: Proposal to provide the facility to set binary format output for specific OID's per session
Date
Msg-id CADK3HHKeO616ck-AR9TL3esJFMP8BBvKK-vn87GsAxscD=ySqQ@mail.gmail.com
Whole thread Raw
In response to Re: Proposal to provide the facility to set binary format output for specific OID's per session  (Sehrope Sarkuni <sehrope@jackdb.com>)
Responses Re: Proposal to provide the facility to set binary format output for specific OID's per session
List pgsql-hackers
Hi Sehrope,


On Mon, 25 Jul 2022 at 17:22, Sehrope Sarkuni <sehrope@jackdb.com> wrote:
Idea here makes sense and I've seen this brought up repeatedly on the JDBC lists.

Does the driver need to be aware that this SET command was executed? I'm wondering what happens if an end user executes this with an OID the driver does not actually know how to handle.
I suppose there would be a failure to read the attribute correctly.

> + Oid *tmpOids = palloc(length+1);
> ...
> + tmpOids = repalloc(tmpOids, length+1);

These should be: sizeof(Oid) * (length + 1)

Yes they should, thanks! 

Also, I think you need to specify an explicit context via MemoryContextAlloc or the allocated memory will be in the default context and released at the end of the command.

Also good catch 

Thanks,

Dave

pgsql-hackers by date:

Previous
From: Sehrope Sarkuni
Date:
Subject: Re: Proposal to provide the facility to set binary format output for specific OID's per session
Next
From: Peter Smith
Date:
Subject: Re: Handle infinite recursion in logical replication setup