Re: Patch: Force Primitives - Mailing list pgsql-jdbc

From Nicholas White
Subject Re: Patch: Force Primitives
Date
Msg-id CA+=vxNZYNgYQFAr0GJFWOqJp89dr=WejYuOGm10Ni+tG-yY3Dg@mail.gmail.com
Whole thread Raw
In response to Re: Patch: Force Primitives  (Mikko Tiihonen <mikko.tiihonen@nitorcreations.com>)
Responses Re: Patch: Force Primitives
List pgsql-jdbc
> So another patch for that would be nice.

I've attached a patch that fixes setPrepareThreshold; previously setting the threshold to n would mean the n+1th query would be the first binary one, and setting it to zero meant the binary protocol would never be used. This means the first query of a statement could never use the binary protocol. The patch makes setting the threshold to n mean the nth query is binary, so setting it to 1 would make the first query use the binary protocol. The patch includes some test cases that demonstrate this.

> The discussion got stuck on weather updates with feature flags, adding a minor version number to the protocol or just wait for pg 10 to break the protocol is the correct way to go forward.

That patch is pretty interesting - but maybe you could preserve backwards-compatibility by making a new format type (so 0 is text, 1 is binary and 2 is binary-with-implied-sizes). A new format type would give you more flexibility; you could even use variable-length or run-length encodings, or compression to represent (only large?) arrays.

Thanks -

Nick
Attachment

pgsql-jdbc by date:

Previous
From: Mikko Tiihonen
Date:
Subject: Re: Patch: Force Primitives
Next
From: Kris Jurka
Date:
Subject: Re: patch to avoid a NullPointerException