From: | Aidan Van Dyk <aidan(at)highrise(dot)ca> |
---|---|
To: | Bruce Momjian <bruce(at)momjian(dot)us> |
Cc: | Gregory Stark <stark(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Bryce Nesbitt <bryce2(at)obviously(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Brendan Jurd <direvus(at)gmail(dot)com>, heikki(at)enterprisedb(dot)com |
Subject: | Re: Proposed patch - psql wraps at window width |
Date: | 2008-05-06 16:53:58 |
Message-ID: | 20080506165358.GH18081@yugib.highrise.ca |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
* Bruce Momjian <bruce(at)momjian(dot)us> [080506 11:59]:
> > But one of the interesting things is that psql has an is *interactive*
> > mode (something the GNU utils don't have to worry about). So *when* you
> > choose to figure out your columns is important, and really impacts
> > behaviour too.
> >
> > For instance, if I was doing a query, I often to it interactively first:
> > SELECT [...] FROM [....] LIMIT 50;
> > And when I'm sure I have the right values,expressions, column aliases,
> > etc, I do:
> > \o /tmp/output
> > SELECT [...] FROM [...];
> > \o
> > And in this case, I would expect that /tmp/output would have identical
> > formatting to the LIMITed query I just ran interactively, not matter
> > what setting I had for format/wrapped/auto/$COLUMNS.
>
> The only thing we could do there perhaps is to have psql wrap file
> output to the terminal width if outputting to a pipe/file, but only from
> an interactive session, but that is just too odd. If we make psql too
> automatic it will be hard to explain and have more surprises.
Yes, and *this* is the tough part. And *I* think that the control of
wrapping/width should be based on psql's output fd/$COLUMNS, not
necessarily the query output buffer fd, because I want the interactive
output to be identical when I run the query and let psql automatically
pipe it through $PAGER and when I run the query and tell psql \o it to
pipe it somewhere specific.
Of course, all over-ridden by some specific \pset to make it all more
complicated ;-)
> I just looked at coreutils-6.9 and 5.97 and neither manual has a mention
> of COLUMNS. Seems this is some Debian manual addition or something. I
> don't see it on Ubuntu 7.10 either.
Yes, the man pages point to the Texinfo manual for full documentation:
http://www.gnu.org/software/coreutils/manual/html_node/General-output-formatting.html#General-output-formatting
a.
--
Aidan Van Dyk Create like a god,
aidan(at)highrise(dot)ca command like a king,
http://www.highrise.ca/ work like a slave.
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Dunstan | 2008-05-06 17:14:16 | alter + preserving dependencies |
Previous Message | Tom Lane | 2008-05-06 16:09:45 | Re: Proposed patch - psql wraps at window width |