Re: default result formats setting

2022-08-07 Thread Dave Cramer
On Sun, 7 Aug 2022 at 09:58, Robert Haas wrote: > On Wed, Mar 24, 2021 at 12:01 PM Tom Lane wrote: > > I don't think I buy the premise that there are exactly two levels > > on the client side. > > Thanks for sharing your thoughts on this. I agree it's a complex > issue, and the idea that there

Re: default result formats setting

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 12:01 PM Tom Lane wrote: > I don't think I buy the premise that there are exactly two levels > on the client side. Thanks for sharing your thoughts on this. I agree it's a complex issue, and the idea that there are possibly more than two logical levels is, for me, maybe

Re: default result formats setting

2021-03-24 Thread Tom Lane
Robert Haas writes: > On Wed, Mar 24, 2021 at 10:58 AM Tom Lane wrote: >> A client that is sending -1 and assuming that it will get back >> a particular format could get broken if the GUC doesn't have the >> value it thinks, true. But I'd argue that such code is unreasonably >> non-robust.

Re: default result formats setting

2021-03-24 Thread Robert Haas
On Wed, Mar 24, 2021 at 10:58 AM Tom Lane wrote: > Robert Haas writes: > > But ... if it's just a GUC, it can be set by code on the server side > > that the client knows nothing about, breaking the client. That seems > > pretty bad to me. > > It's impossible for the proposed patch to break

Re: default result formats setting

2021-03-24 Thread Tom Lane
Robert Haas writes: > But ... if it's just a GUC, it can be set by code on the server side > that the client knows nothing about, breaking the client. That seems > pretty bad to me. It's impossible for the proposed patch to break *existing* clients, because they all send requested format 0 or 1,

Re: default result formats setting

2021-03-24 Thread Robert Haas
On Thu, Nov 5, 2020 at 3:49 PM Peter Eisentraut wrote: > We could also make it a protocol message, but it would essentially > implement the same thing, just again separately. And then you'd have no > support to inspect the current setting, test out different settings > interactively, etc. That

Re: default result formats setting

2021-03-24 Thread Emre Hasegeli
I think this is a good feature that would be useful to JDBC and more. I don't know the surrounding code very well, but the patch looks good to me. I agree with Tom Lane that the name of the variable is too verbose. Maybe "auto_binary_types" is enough. Do we gain much by prefixing

Re: default result formats setting

2021-03-22 Thread Peter Eisentraut
On 21.03.21 20:18, Emre Hasegeli wrote: Could you look into the log files in that test directory what is going on? Command 'test-result-format' not found in /Users/hasegeli/Developer/postgres/tmp_install/Users/hasegeli/.local/pgsql/bin, /Users/hasegeli/.local/bin, /opt/homebrew/bin,

Re: default result formats setting

2021-03-21 Thread Emre Hasegeli
> Could you look into the log files in that test directory what is going > on? Command 'test-result-format' not found in /Users/hasegeli/Developer/postgres/tmp_install/Users/hasegeli/.local/pgsql/bin, /Users/hasegeli/.local/bin, /opt/homebrew/bin, /usr/local/bin, /usr/bin, /bin, /usr/sbin, /sbin,

Re: default result formats setting

2021-03-21 Thread Peter Eisentraut
On 19.03.21 15:55, Emre Hasegeli wrote: I applied the patch, tried running the test and got the following: rm -rf '/Users/hasegeli/Developer/postgres/src/test/modules/libpq_extended'/tmp_check /bin/sh ../../../../config/install-sh -c -d

Re: default result formats setting

2021-03-19 Thread Emre Hasegeli
I applied the patch, tried running the test and got the following: rm -rf '/Users/hasegeli/Developer/postgres/src/test/modules/libpq_extended'/tmp_check /bin/sh ../../../../config/install-sh -c -d '/Users/hasegeli/Developer/postgres/src/test/modules/libpq_extended'/tmp_check cd . &&

Re: default result formats setting

2021-03-18 Thread Peter Eisentraut
On 09.03.21 19:04, Tom Lane wrote: The implementation feels weird though, mainly in that I don't like Peter's choices for where to put the code. pquery.c is not where I would have expected to find the support for this, and I do not have any confidence that applying the format conversion while

Re: default result formats setting

2021-03-09 Thread Tom Lane
David Steele writes: > Andrew, Tom, does the latest patch address your concerns? [ reads patch quickly... ] I think the definition is fine now, modulo possible bikeshedding on the GUC name. (I have no great suggestion on that right now, but the current proposal seems mighty verbose.) The

Re: default result formats setting

2021-03-09 Thread David Steele
On 11/25/20 2:06 AM, Peter Eisentraut wrote: On 2020-11-16 16:15, Andrew Dunstan wrote: I think this is conceptually OK, although it feels a bit odd. Might it be better to have the values as typename={binary,text} pairs instead of oid={0,1} pairs, which are fairly opaque? That might make

Re: default result formats setting

2020-11-24 Thread Peter Eisentraut
On 2020-11-16 16:15, Andrew Dunstan wrote: I think this is conceptually OK, although it feels a bit odd. Might it be better to have the values as typename={binary,text} pairs instead of oid={0,1} pairs, which are fairly opaque? That might make things easier for things like UDTs where the oid

Re: default result formats setting

2020-11-16 Thread Andrew Dunstan
On 11/9/20 5:10 AM, Peter Eisentraut wrote: > On 2020-11-05 22:03, Peter Eisentraut wrote: >>> Independently of that, how would you implement "says otherwise" here, >>> ie do a single-query override of the session's prevailing setting? >>> Maybe the right thing for that is to define -1 all the

Re: default result formats setting

2020-11-09 Thread Peter Eisentraut
On 2020-11-05 22:03, Peter Eisentraut wrote: Independently of that, how would you implement "says otherwise" here, ie do a single-query override of the session's prevailing setting? Maybe the right thing for that is to define -1 all the way down to the protocol level as meaning "use the

Re: default result formats setting

2020-11-05 Thread Pavel Stehule
čt 5. 11. 2020 v 21:48 odesílatel Peter Eisentraut < peter.eisentr...@2ndquadrant.com> napsal: > On 2020-10-26 09:45, Pavel Stehule wrote: > > The attached patch implements this. For example, to get int2, int4, > > int8 in binary by default, you could set > > > > SET

Re: default result formats setting

2020-11-05 Thread Peter Eisentraut
On 2020-10-26 15:35, Tom Lane wrote: In the discussion in [0], I pondered a new protocol message for that, but after further thought, a GUC setting would do just as well. I think a GUC is conceptually the wrong level ... It does feel that way, but it gets the job done well and you can use

Re: default result formats setting

2020-11-05 Thread Peter Eisentraut
On 2020-10-26 09:45, Pavel Stehule wrote: The attached patch implements this.  For example, to get int2, int4, int8 in binary by default, you could set SET default_result_formats = '21=1,23=1,20=1'; Using SET statement for this case looks very obscure :/ This is a protocol

Re: default result formats setting

2020-10-26 Thread Tom Lane
Peter Eisentraut writes: > The conceptual solution is to allow a client to register for a session > which types it wants to always get in binary, unless it says otherwise. OK. > In the discussion in [0], I pondered a new protocol message for that, > but after further thought, a GUC setting

Re: default result formats setting

2020-10-26 Thread Pavel Stehule
po 26. 10. 2020 v 9:31 odesílatel Peter Eisentraut < peter.eisentr...@2ndquadrant.com> napsal: > During the discussion on dynamic result sets[0], it became apparent that > the current way binary results are requested in the extended query > protocol is too cumbersome for some practical uses, and

default result formats setting

2020-10-26 Thread Peter Eisentraut
During the discussion on dynamic result sets[0], it became apparent that the current way binary results are requested in the extended query protocol is too cumbersome for some practical uses, and keeping that style around would also make the proposed protocol extensions very complicated. The