Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-07 Thread Decibel!
On Apr 3, 2008, at 9:35 AM, Tom Lane wrote: "Dawid Kuroczko" <[EMAIL PROTECTED]> writes: The idea of \G command is to perform the query, but with printing query results using extended table output format. Seems a bit useless --- if you prefer \x format, wouldn't you prefer it all the time?

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-04 Thread Bruce Momjian
Dawid Kuroczko wrote: > 2. Do we want \G? I would say "yes". ;) But it should get discussed. > pgsql-general perhaps? No. We have had little demand for the auto, let alone a \G. Once we have auto I don't see a use for \G. -- Bruce Momjian <[EMAIL PROTECTED]>http://momjian.us Ente

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-04 Thread Alvaro Herrera
Dawid Kuroczko escribió: > Hmm, seems doable. I think that the followup discussion leads to implementing just \G (and \x auto). > I think there should be a format Enum, which would take values like NORMAL, > EXTENDED, and EXTENDED_ONCE -- but this would be a much more invasive patch. > Oh, and c

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-04 Thread Dawid Kuroczko
On Thu, Apr 3, 2008 at 6:44 PM, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > Bruce Momjian escribió: > > > > It seems more helpful if there were \x option to use extended format > > only when the output is too wide. TODO already has: > > > > o Add auto-expanded mode so expanded output i

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Tom Lane escribió: >> Huh? The proposed syntax was >> >> \x query... >> >> What do you do when you'd like the query to extend over multiple lines? >> Backslash commands can't cross lines. > Save the fact that the current query is extended, until que

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Alvaro Herrera
Tom Lane escribió: > Huh? The proposed syntax was > > \x query... > > What do you do when you'd like the query to extend over multiple lines? > Backslash commands can't cross lines. Save the fact that the current query is extended, until query end? I haven't actually looked at what the

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Tom Lane escribió: >> A bigger problem is that it doesn't play nicely at all with multi-line >> queries. > Hmm, why wouldn't it? I assume it would only be recognized if the query > buffer is empty. Huh? The proposed syntax was \x query...

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Alvaro Herrera
Tom Lane escribió: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > I think Martijn is proposing using it as some sort of prefix which would > > take effect only on the current query. > > A bigger problem is that it doesn't play nicely at all with multi-line > queries. Hmm, why wouldn't it? I a

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Bruce Momjian escribió: >> Martijn van Oosterhout wrote: >>> I was thinking that maybe \x should have a one-shot mode, i.e. >>> \x >>> does it only for this one statement. It would solve the OPs problem. >> >> But break for others who want all output \

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Alvaro Herrera
Bruce Momjian escribió: > Martijn van Oosterhout wrote: > > I was thinking that maybe \x should have a one-shot mode, i.e. > > > > \x > > > > does it only for this one statement. It would solve the OPs problem. > > But break for others who want all output \x. I think Martijn is proposing usin

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Merlin Moncure
On Thu, Apr 3, 2008 at 4:08 PM, David Fetter <[EMAIL PROTECTED]> wrote: > > On Thu, Apr 03, 2008 at 03:43:50PM -0400, Merlin Moncure wrote: > > On Thu, Apr 3, 2008 at 2:43 PM, David Fetter <[EMAIL PROTECTED]> wrote: > > > On Thu, Apr 03, 2008 at 01:06:26PM -0400, Bruce Momjian wrote: > > > > >

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread David Fetter
On Thu, Apr 03, 2008 at 03:43:50PM -0400, Merlin Moncure wrote: > On Thu, Apr 3, 2008 at 2:43 PM, David Fetter <[EMAIL PROTECTED]> wrote: > > On Thu, Apr 03, 2008 at 01:06:26PM -0400, Bruce Momjian wrote: > > > > Some sort of "\x auto"? Sounds interesting ... > > > > > > Yep. > > > > Having \d

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Merlin Moncure
On Thu, Apr 3, 2008 at 2:43 PM, David Fetter <[EMAIL PROTECTED]> wrote: > On Thu, Apr 03, 2008 at 01:06:26PM -0400, Bruce Momjian wrote: > > > Some sort of "\x auto"? Sounds interesting ... > > > > Yep. > > Having \df+ go to \x automatically sounds like a really great idea :) you can get pret

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread David Fetter
On Thu, Apr 03, 2008 at 01:06:26PM -0400, Bruce Momjian wrote: > Alvaro Herrera wrote: > > Bruce Momjian escribi?: > > > > > It seems more helpful if there were \x option to use extended format > > > only when the output is too wide. TODO already has: > > > > > > o Add auto-expanded mode

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Bruce Momjian
Martijn van Oosterhout wrote: -- Start of PGP signed section. > On Thu, Apr 03, 2008 at 12:07:54PM -0400, Bruce Momjian wrote: > > > Alternating between formats using "\x" is, at least for me, a bit > > > cumbersome: usually _after_ I wrote a query I realize "it would > > > look more readable in ex

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Bruce Momjian
Alvaro Herrera wrote: > Bruce Momjian escribi?: > > > It seems more helpful if there were \x option to use extended format > > only when the output is too wide. TODO already has: > > > > o Add auto-expanded mode so expanded output is used if the row > > length is wider than the

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Martijn van Oosterhout
On Thu, Apr 03, 2008 at 12:07:54PM -0400, Bruce Momjian wrote: > > Alternating between formats using "\x" is, at least for me, a bit > > cumbersome: usually _after_ I wrote a query I realize "it would > > look more readable in expanded format", which is a bit too late. > > So I run the query, ctrl+

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Alvaro Herrera
Bruce Momjian escribió: > It seems more helpful if there were \x option to use extended format > only when the output is too wide. TODO already has: > > o Add auto-expanded mode so expanded output is used if the row > length is wider than the screen width. > > Consid

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Bruce Momjian
Dawid Kuroczko wrote: > On Thu, Apr 3, 2008 at 4:35 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > > "Dawid Kuroczko" <[EMAIL PROTECTED]> writes: > > > The idea of \G command is to perform the query, but with printing > > > query results using extended table output format. > > > > Seems a bit useless

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Dawid Kuroczko
On Thu, Apr 3, 2008 at 4:35 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Dawid Kuroczko" <[EMAIL PROTECTED]> writes: > > The idea of \G command is to perform the query, but with printing > > query results using extended table output format. > > Seems a bit useless --- if you prefer \x format, woul

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Tom Lane
"Dawid Kuroczko" <[EMAIL PROTECTED]> writes: > The idea of \G command is to perform the query, but with printing > query results using extended table output format. Seems a bit useless --- if you prefer \x format, wouldn't you prefer it all the time? Or at least often enough that the toggling com

Re: [HACKERS] psql \G command -- send query and output using extended format

2008-04-03 Thread Dawid Kuroczko
Hi! I have sent a patch to pgsql-patches: http://archives.postgresql.org/pgsql-patches/2008-04/msg00050.php ...which adds \G command to psql client. The idea of \G command is to perform the query, but with printing query results using extended table output format. For example: postgres=# SELE