Re: [HACKERS] proposal psql \gdesc

2017-09-05 Thread Pavel Stehule
2017-09-06 0:18 GMT+02:00 Tom Lane : > Fabien COELHO writes: > > I did yet another rebase of your patch after Tom alphabetically ordered > > backslash commands. Here is the result. > > Pushed with some massaging. > Thank you very much > >

Re: [HACKERS] proposal psql \gdesc

2017-09-05 Thread Tom Lane
Fabien COELHO writes: > I did yet another rebase of your patch after Tom alphabetically ordered > backslash commands. Here is the result. Pushed with some massaging. regards, tom lane -- Sent via pgsql-hackers mailing list

Re: [HACKERS] proposal psql \gdesc

2017-06-18 Thread Pavel Stehule
2017-06-16 8:45 GMT+02:00 Fabien COELHO : > > Hello Pavel, > > new update - rebase, changed message >> > > I did yet another rebase of your patch after Tom alphabetically ordered > backslash commands. Here is the result. It looks well Thank you Pavel > > > -- > Fabien.

Re: [HACKERS] proposal psql \gdesc

2017-06-16 Thread Fabien COELHO
Hello Pavel, new update - rebase, changed message I did yet another rebase of your patch after Tom alphabetically ordered backslash commands. Here is the result. -- Fabien.diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index e6eba21..833460e 100644 ---

Re: [HACKERS] proposal psql \gdesc

2017-06-05 Thread Fabien COELHO
new update - rebase, changed message Thanks. New patch applies cleanly, make check still ok. -- Fabien. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] proposal psql \gdesc

2017-06-04 Thread Pavel Stehule
Hi 2017-06-04 10:47 GMT+02:00 Fabien COELHO : > > Hello Brent, > > Regarding the error message earlier >> > > 'No columns or command has no result', >> > > it might be clearer with the slightly longer >> > > 'The result has no columns or the command has no result'. >> > > I

Re: [HACKERS] proposal psql \gdesc

2017-06-04 Thread Fabien COELHO
Hello Brent, Regarding the error message earlier 'No columns or command has no result', it might be clearer with the slightly longer 'The result has no columns or the command has no result'. I agree that a better phrasing may be possible. I'm hesitating about this one because word

Re: [HACKERS] proposal psql \gdesc

2017-06-04 Thread Brent Douglas
Regarding the error message earlier 'No columns or command has no result', it might be clearer with the slightly longer 'The result has no columns or the command has no result'. I didn't read the patch though, just the email so that might not make sense in context. Brent On Sun, Jun 4, 2017 at

Re: [HACKERS] proposal psql \gdesc

2017-06-04 Thread Fabien COELHO
ok - look on new version, please The patch needs a rebase after Tom's reindentation of tab-complete. -- Fabien. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] proposal psql \gdesc

2017-05-21 Thread Pavel Stehule
2017-05-21 8:39 GMT+02:00 Fabien COELHO : > > Hello Pavel, > > v6 patch applies cleanly; make check ok; code, comments, doc & tests ok; > various interactive tests I did ok. > > Thanks for this useful little feature! > > Let's see what committers think about it. Thank you

Re: [HACKERS] proposal psql \gdesc

2017-05-21 Thread Fabien COELHO
Hello Pavel, v6 patch applies cleanly; make check ok; code, comments, doc & tests ok; various interactive tests I did ok. Thanks for this useful little feature! Let's see what committers think about it. -- Fabien. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To

Re: [HACKERS] proposal psql \gdesc

2017-05-20 Thread Pavel Stehule
2017-05-20 22:26 GMT+02:00 Fabien COELHO : > > Hello Pavel, > > - Maybe tests could also exercise unnamed columns, eg: >>> SELECT 1, 2, 3 \gdesc \g >>> >> >> done >> > > Can't see it. No big deal, but if you put it it did not get through, and > there is a warning with

Re: [HACKERS] proposal psql \gdesc

2017-05-20 Thread Fabien COELHO
Hello Pavel, - Maybe tests could also exercise unnamed columns, eg: SELECT 1, 2, 3 \gdesc \g done Can't see it. No big deal, but if you put it it did not get through, and there is a warning with git apply on the very last line of the patch which may be linked to that:

Re: [HACKERS] proposal psql \gdesc

2017-05-20 Thread Pavel Stehule
Hi 2017-05-20 9:15 GMT+02:00 Fabien COELHO : > > Hello Pavel, > > I am sending a variant with message instead empty result. >> > > Thanks. Patch looks good, applies, make check ok, code is neat. > > Personally I prefer empty result instead message. >> > > Hmm. I think that

Re: [HACKERS] proposal psql \gdesc

2017-05-20 Thread Fabien COELHO
Hello Pavel, I am sending a variant with message instead empty result. Thanks. Patch looks good, applies, make check ok, code is neat. Personally I prefer empty result instead message. Hmm. I think that this version is less likely to raise questions from users, especially compared to

Re: [HACKERS] proposal psql \gdesc

2017-05-15 Thread Pavel Stehule
2017-05-09 23:00 GMT+02:00 Fabien COELHO : > > What about detecting the empty result (eg PQntuples()==0?) and writing >>> "Empty result" instead of the strange looking empty table above? That >>> would >>> just mean skipping the PrintQueryResult call in this case? >>> >> >>

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Fabien COELHO
What about detecting the empty result (eg PQntuples()==0?) and writing "Empty result" instead of the strange looking empty table above? That would just mean skipping the PrintQueryResult call in this case? PQntuples == 0 every time - the query is not executed. I meant to test the query

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Pavel Stehule
2017-05-09 21:23 GMT+02:00 Peter Eisentraut < peter.eisentr...@2ndquadrant.com>: > On 5/3/17 02:56, Pavel Stehule wrote: > > Sometimes I have to solve the result types of some query. It is > > invisible in psql. You have to materialize table or you have to > > create view. Now, when

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Peter Eisentraut
On 5/3/17 02:56, Pavel Stehule wrote: > Sometimes I have to solve the result types of some query. It is > invisible in psql. You have to materialize table or you have to > create view. Now, when we can enhance \g command, we can introduce > query describing > > some like > >

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Pavel Stehule
2017-05-09 20:37 GMT+02:00 Fabien COELHO : > > Hello Pavel, > > [...] it is little bit worse. I cannot to distinguish between SELECT\gdesc >> and TRUNCATE xxx\gdesc . All are valid commands and produce empty result, >> so result of \gdesc command should be empty result too.

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Fabien COELHO
Hello Pavel, [...] it is little bit worse. I cannot to distinguish between SELECT\gdesc and TRUNCATE xxx\gdesc . All are valid commands and produce empty result, so result of \gdesc command should be empty result too. postgres=# truncate table xx\gdesc ┌──┬──┐ │ Name │ Type │

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Pavel Stehule
2017-05-09 18:15 GMT+02:00 Fabien COELHO : > > Hello Pavel, > > Patch applies cleanly and compiles. >>> >> > Idem for v2. "make check" ok. Tests look good. > > I would suggest some rewording, maybe: >>> >>> "Show the description of the result of the current query buffer

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Fabien COELHO
Hello Pavel, Patch applies cleanly and compiles. Idem for v2. "make check" ok. Tests look good. I would suggest some rewording, maybe: "Show the description of the result of the current query buffer without actually executing it, by considering it a prepared statement." done Ok. If

Re: [HACKERS] proposal psql \gdesc

2017-05-09 Thread Pavel Stehule
Hi 2017-05-07 22:55 GMT+02:00 Fabien COELHO : > > Hello Pavel, > > Sometimes I have to solve the result types of some query. It is invisible >>> in psql. >>> >> > Indeed. My 0.02€ about this patch: > > > About the feature: > > It looks useful to allow to show the resulting

Re: [HACKERS] proposal psql \gdesc

2017-05-08 Thread Pavel Stehule
2017-05-08 12:59 GMT+02:00 Fabien COELHO : > > Hello Pavel, > > After giving it some thoughts, I see three possible solutions: >>> >>> 0. Do nothing about it. >>>I would prefer the prepare is cleaned up. >>> >>> 1. assign a special name, eg "_psql_gdesc_", so that >>>

Re: [HACKERS] proposal psql \gdesc

2017-05-08 Thread Fabien COELHO
Hello Pavel, After giving it some thoughts, I see three possible solutions: 0. Do nothing about it. I would prefer the prepare is cleaned up. 1. assign a special name, eg "_psql_gdesc_", so that DEALLOCATE "_psql_gdesc_" can be issued afterwards. [...] The doc says about unnamed

Re: [HACKERS] proposal psql \gdesc

2017-05-08 Thread Pavel Stehule
Hi 2017-05-08 9:08 GMT+02:00 Fabien COELHO : > > Hello Pavel, > > A complement to my previous comments: > > Also, maybe it would be better if the statement is cleaned up server side >> at the end of the execution. Not sure how to achieve that, though, libpq >> seems to lack

Re: [HACKERS] proposal psql \gdesc

2017-05-08 Thread Fabien COELHO
Hello Pavel, A complement to my previous comments: Also, maybe it would be better if the statement is cleaned up server side at the end of the execution. Not sure how to achieve that, though, libpq seems to lack the relevant function:-( """although there is no libpq function for deleting

Re: [HACKERS] proposal psql \gdesc

2017-05-07 Thread Fabien COELHO
Hello Pavel, Sometimes I have to solve the result types of some query. It is invisible in psql. Indeed. My 0.02€ about this patch: About the feature: It looks useful to allow to show the resulting types of a query. About the code: Patch applies cleanly and compiles. I'm afraid that

Re: [HACKERS] proposal psql \gdesc

2017-05-03 Thread Pavel Stehule
2017-04-28 6:08 GMT+02:00 Pavel Stehule : > Hi > > Sometimes I have to solve the result types of some query. It is invisible > in psql. You have to materialize table or you have to create view. Now, > when we can enhance \g command, we can introduce query describing > >

[HACKERS] proposal psql \gdesc

2017-04-27 Thread Pavel Stehule
Hi Sometimes I have to solve the result types of some query. It is invisible in psql. You have to materialize table or you have to create view. Now, when we can enhance \g command, we can introduce query describing some like select a, b from foo \gdesc | type | length | collation |