vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Bruce Momjian wrote: > We have discussed having a formatting mode where aligned output switches > to expanded output when the row is too wide. One idea would be to > create an 'auto' mode that would display in aligned, or wrapped if that > doesn't fit, or expanded if that doesn't fit. I haven't heard any new ideas of how to resolve this issue in the past few hours so I will throw out two new ideas. Have a 'format=auto' mode that does aligned/wrapped/expanded, but only for screen output --- file/pipe would still use aligned. And have 'format=wrapped' affect file/pipe by requiring the user to specify the width, or use a default of 72. Another idea is to require the user to specify the file/pipe output width when they define format=wrapped, e.g. format=wrapped:75. If they don't specify the width, 'wrapped' doesn't affect file/pipe. (Perhaps the width controls screen width too.) (That is effectively what \pset columns does, but this is more integrated.) I have heard why people want 'wrapped' to affect file/pipe output, but I have not heard a clear explanation of why people don't want that. I personally think that having the screen width affect the width of file/pipe is odd, but if the user specifies the width, it seems fine to me. What is the objection? -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. + -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |
| |||
| Bruce Momjian escribió: > Have a 'format=auto' mode that does aligned/wrapped/expanded, but only > for screen output --- file/pipe would still use aligned. And have > 'format=wrapped' affect file/pipe by requiring the user to specify the > width, or use a default of 72. I have a different question. Why are we mixing file and pipe output? I think the use cases are different and perhaps we should use different defaults. For example, most people I've seen writing shell scripts involving psql output have to pass the -A flag all the time. Perhaps we could change the default output to unaligned for pipes? -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |
| |||
| On Fri, 25 Apr 2008 10:45:01 -0400 Alvaro Herrera <alvherre@commandprompt.com> wrote: > I have a different question. Why are we mixing file and pipe > output? I think the use cases are different and perhaps we should > use different defaults. > > For example, most people I've seen writing shell scripts involving > psql output have to pass the -A flag all the time. Perhaps we could > change the default output to unaligned for pipes? and -t Sincerely, Joshua D. Drake -- The PostgreSQL Company since 1997: http://www.commandprompt.com/ PostgreSQL Community Conference: http://www.postgresqlconference.org/ United States PostgreSQL Association: http://www.postgresql.us/ Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |
| |||
| Alvaro Herrera wrote: > Bruce Momjian escribi?: > > > Have a 'format=auto' mode that does aligned/wrapped/expanded, but only > > for screen output --- file/pipe would still use aligned. And have > > 'format=wrapped' affect file/pipe by requiring the user to specify the > > width, or use a default of 72. > > I have a different question. Why are we mixing file and pipe output? I > think the use cases are different and perhaps we should use different > defaults. > > For example, most people I've seen writing shell scripts involving psql > output have to pass the -A flag all the time. Perhaps we could change > the default output to unaligned for pipes? Yes, that would make sense to me. I think the people wanting wrapped to control file/pipe don't want it as the default, but want _some_ way of getting wrapped output into a file. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. + -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |
| |||
| Bruce Momjian wrote: > Alvaro Herrera wrote: > > Bruce Momjian escribi?: > > > > > Have a 'format=auto' mode that does aligned/wrapped/expanded, but only > > > for screen output --- file/pipe would still use aligned. And have > > > 'format=wrapped' affect file/pipe by requiring the user to specify the > > > width, or use a default of 72. > > > > I have a different question. Why are we mixing file and pipe output? I > > think the use cases are different and perhaps we should use different > > defaults. > > > > For example, most people I've seen writing shell scripts involving psql > > output have to pass the -A flag all the time. Perhaps we could change > > the default output to unaligned for pipes? > > Yes, that would make sense to me. > > I think the people wanting wrapped to control file/pipe don't want it as > the default, but want _some_ way of getting wrapped output into a file. Let me add that the patch as it was posted does not have wrapping affecting file/pipe output unless you also specify a column width with \pset. This seemed the most logical and tried to satisfy the most people. You can see this in the documentation changes of the patch: ftp://momjian.us/pub/postgresql/mypatches/wrap I have now clarified the documentation in the patch. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. + -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |
| |||
| "Bruce Momjian" <bruce@momjian.us> writes: >> I think the people wanting wrapped to control file/pipe don't want it as >> the default, but want _some_ way of getting wrapped output into a file. > > Let me add that the patch as it was posted does not have wrapping > affecting file/pipe output unless you also specify a column width with > \pset. This seemed the most logical and tried to satisfy the most > people. You can see this in the documentation changes of the patch: If you specify format=wrapped and get something other than wrapped it's a bug and people will undoubtedly report it as such. If you want a way to specify "wrapped on a terminal but not to a non-terminal" then you should make that explicit and separate from the column-width determination. I'm done with this thread now. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com Ask me about EnterpriseDB's 24x7 Postgres support! -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |
| |||
| -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, Apr 26, 2008 at 4:46 AM, Gregory Stark wrote: > If you specify format=wrapped and get something other than wrapped it's a bug > and people will undoubtedly report it as such. > Agree. If I tell psql that I want wrapped output and it gives me something else when I output to a file, I'm going to be confused. In particular, I often work up a query in psql, making revisions with \e, and when I've got the results I want, I do a \g out.txt to dump the query output into a file. I expect that the contents of out.txt will be exactly the same as the query output I've just been crafting in psql. If I want to output the query in a machine-readable form to a file, I just use \a to switch to unaligned output. Aside: \a should probably be changed to toggle between "unaligned" and "aligned"/"wrapped", whichever of the two you had selected last. Cheers, BJ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: http://getfiregpg.org iD8DBQFIEixE5YBsbHkuyV0RArhoAKDUH/Svt84xPFn7BGRkq7zEWtonpwCg/pOS 66uQ6mKWvxnZLICfAcJzdLw= =ibbj -----END PGP SIGNATURE----- -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |
| |||
| Brendan Jurd wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Sat, Apr 26, 2008 at 4:46 AM, Gregory Stark wrote: > > If you specify format=wrapped and get something other than wrapped it's a bug > > and people will undoubtedly report it as such. > > > > Agree. If I tell psql that I want wrapped output and it gives me > something else when I output to a file, I'm going to be confused. > > In particular, I often work up a query in psql, making revisions with > \e, and when I've got the results I want, I do a \g out.txt to dump > the query output into a file. > > I expect that the contents of out.txt will be exactly the same as the > query output I've just been crafting in psql. Obviously you have expections of how wrapping should behave. Please name me an application that has a wrapped mode that has the output to a file wrap based on the screen width? It isn't 'ls -C'. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. + -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |
| |||
| Bruce Momjian escribió: > Obviously you have expections of how wrapping should behave. Please > name me an application that has a wrapped mode that has the output to a > file wrap based on the screen width? It isn't 'ls -C'. Why would we need to imitate what other apps do? What we need to investigate is use cases, and how do we cater for each one, making it easy for the most common while at the same time making it not impossible for the most obscure. There is no point in doing things in a certain way just because others do the same. Are you going to argue that we need to make the server crash from time to time because other systems do that too? We came up with dollar quoting which is a completely novel idea AFAIK. Why can't we come up with other useful, novel designs? -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |
| ||||
| -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, Apr 26, 2008 at 5:21 AM, Bruce Momjian wrote: > Obviously you have expections of how wrapping should behave. Please > name me an application that has a wrapped mode that has the output to a > file wrap based on the screen width? It isn't 'ls -C'. > Trying to draw analogies between psql and other command-line tools is always going to be a bit of a stretch. Name me any application at all that tries to produce both human- and machine- readable representations of arbitrary tabular data. All I'm saying is, if the user has exlicitly told psql that he wants wrapped, human-readable output, we should give it to him regardless of where he wants to put it. If the user hasn't specified any format at all, then it's fine to play guessing games and try to select the best format automatically for him, based on factors like the destination. But IMO once the user makes a determination about the output format, that's the end of the story. You toe that line. Cheers, BJ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: http://getfiregpg.org iD8DBQFIEju85YBsbHkuyV0RAgNTAJ4ghWB1SlvuQhsH3ltrbV M5LoMBwACgoTdT B6UDw4oG5tlwTlcLcJA4xic= =2lmV -----END PGP SIGNATURE----- -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |