Re: Proposal to provide the facility to set binary format output for specific OID's per session

From: Sehrope Sarkuni <sehrope(at)jackdb(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Jack Christensen <jack(at)jackchristensen(dot)com>, Dave Cramer <davecramer(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Proposal to provide the facility to set binary format output for specific OID's per session
Date: 2022-07-25 21:22:24
Message-ID: CAH7T-arqow+s_RE7ap0VNftSUtY_EOWY5sfnZE7ksMrD6cXXsg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

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

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

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.

Regards,
-- Sehrope Sarkuni
Founder & CEO | JackDB, Inc. | https://www.jackdb.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2022-07-25 21:53:10 Re: Proposal to provide the facility to set binary format output for specific OID's per session
Previous Message Nikita Malakhov 2022-07-25 21:20:23 Re: Pluggable toaster