Re: [HACKERS] unexpected psql "feature"

2016-07-14 Thread Geoff Winkless
On 14 July 2016 at 00:12, Tom Lane wrote: > I wonder > whether promoting \; to a recognized and documented behavior would > allow us to get away with converting -c strings to normal parsing > behavior, as was discussed and then rejected on compatibility grounds > not too long ago. People who nee

Re: [HACKERS] unexpected psql "feature"

2016-07-14 Thread Fabien COELHO
Consider a throttled read-only load composed of 3 random selects, several rounds (so.sql) vs one (so2.sql): > pgbench -h server -T 100 -P 1 --rate 200 -c 2 -f so.sql -f so2.sql SQL script 1: so.sql - latency average = 1.878 ms SQL script 2: so2.sql - latency average = 1.089 ms There is 0.8

Re: [HACKERS] unexpected psql "feature"

2016-07-14 Thread Fabien COELHO
Hello David, Why would you choose to execute "SELECT 1 \; SELECT 2;" instead of "SELECT 1; SELECT 2;"​ in a setup where the behavior of both strings is identical? Or, rather, how would they differ? The answer is that at the protocol level the first one is one network round trip with the serv

Re: [HACKERS] unexpected psql "feature"

2016-07-13 Thread Tom Lane
Alvaro Herrera writes: > Now, I think requesting psql not to split query strings is a good > feature, but having it depend on using \; instead of ; seems way too > obscure. If we want to offer that choice, I propose we do it via some > properly designed mechanism rather than being a random emerge

Re: [HACKERS] unexpected psql "feature"

2016-07-13 Thread Alvaro Herrera
David G. Johnston wrote: > On Wed, Jul 13, 2016 at 5:44 PM, Fabien COELHO wrote: > > > Although "\;" behavior is not documented, I would have expected both > >>> results to be shown one after the other, or having a an error, but not a > >>> quiet discard. > >> > >> See the documentation for PQexe

Re: [HACKERS] unexpected psql "feature"

2016-07-13 Thread David G. Johnston
On Wed, Jul 13, 2016 at 5:44 PM, Fabien COELHO wrote: > > Hello Tom, > > Although "\;" behavior is not documented, I would have expected both >>> results to be shown one after the other, or having a an error, but not a >>> quiet discard. >>> >> >> See the documentation for PQexec(): all but the l

Re: [HACKERS] unexpected psql "feature"

2016-07-13 Thread David G. Johnston
On Wed, Jul 13, 2016 at 5:44 PM, Fabien COELHO wrote: > >> I do not think changing this is appropriate. All you are likely to >> accomplish is breaking code that does what its author wanted. >> > > Hmmm... My 0.02€: Currently this feature is NOT documented, so somehow it > is not supported, and

Re: [HACKERS] unexpected psql "feature"

2016-07-13 Thread Fabien COELHO
Hello Tom, Although "\;" behavior is not documented, I would have expected both results to be shown one after the other, or having a an error, but not a quiet discard. See the documentation for PQexec(): all but the last query result is discarded. Sure. That is developer-level answer to "wh

Re: [HACKERS] unexpected psql "feature"

2016-07-13 Thread Tom Lane
Fabien COELHO writes: > Hello devs, > Although this is probably a "feature", it is a weird one: > $ psql > psql (9.6beta2) > fabien=# SELECT 1 AS one \; > fabien-# SELECT 2 AS two ; >two > - > 2 > (1 row) > Where is my "1"? > Although "\;" behavior is not documented, I

Re: [HACKERS] unexpected psql "feature"

2016-07-13 Thread Fabien COELHO
Hello David, At least we aggree that having a documentation would be an improvement:-) On the second point: - all results should be shown, not just the last one disagree # select 1 ; select 2 ; vs # select 1 \; select 2 ; Result in identical behavior seems undesirable. In both case

Re: [HACKERS] unexpected psql "feature"

2016-07-13 Thread David G. Johnston
On Wed, Jul 13, 2016 at 4:47 PM, Fabien COELHO wrote: > > I would suggest that: > - the \; psql feature should be documented somewhere > ​agreed ​ > - all results should be shown, not just the last one > disagree # select 1 ; select 2 ; ?column? -- 1 (1 row) ?column? -