From: Roger Leigh on
On Mon, Oct 26, 2009 at 01:33:19PM -0400, Tom Lane wrote:
> Greg Stark <gsstark(a)mit.edu> writes:
> > While i agree this looks nicer I wonder what it does to things like
> > excel/gnumeric/ooffice auto-recognizing table layouts and importing
> > files. I'm not sure our old format was so great for this so maybe this
> > is actually an improvement I'm asking for.
>
> Yeah. We can do what we like with the UTF8 format but I'm considerably
> more worried about the aspect of making random changes to the
> plain-ASCII output. On the other hand, we changed that just a release
> or so ago (to put in the multiline output in the first place) and
> I didn't hear complaints about it that time.

The attached updated patch makes sure that the ASCII display remains
the same (bar trailing whitespace used for padding).

I'm tempted to add an additional ascii format such as "ascii-clean"
which cleans up the inconsistencies in the formatting as for the
unicode format, while the existing ascii format would remain the
default for backwards compatibility.


Regards,
Roger

--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
From: Greg Stark on
On Mon, Oct 26, 2009 at 11:43 PM, Peter Eisentraut <peter_e(a)gmx.net> wrote:
> On Mon, 2009-10-26 at 10:12 -0700, Greg Stark wrote:
>> While i agree this looks nicer I wonder what it does to things like
>> excel/gnumeric/ooffice auto-recognizing table layouts and importing
>> files. I'm not sure our old format was so great for this so maybe this
>> is actually an improvement I'm asking for. But as long as we're
>> changing the format... It would at at least be good to test the
>> behaviour
>
> What exactly are you referring to here?

run something like this:

$ psql
stark=> \o /tmp/s
stark=> select generate_series(1,10),generate_series(1,5);
$ gnumeric /tmp/s&
$ ooffice /tmp/s&
$ kspread /tmp/s&

With the 8.4 formatting gnumeric automatically guesses that | is the
separator and formats the speadsheet quite reasonably. Open Office
gets confused and opens the word processor, but if you do "insert
sheet from file" and manually deselect the space and semicolon
delimiters and put | as an "other" delimiter then it looks like it
should work. I don't have kspread handy.

Does gnumeric still autorecognize the new formats? Do the newline
indicators in 8.4 mess up gnumeric? Are the new ones better or worse?

This hasn't been a top priority in the past and the ReST discussion
seemed to end up concluding that we shouldn't bother if we can't make
it perfect. I'm not sure I agree with that, but in any case I think as
long as we're changing the format we may as well check to see what the
status is.



--
greg

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Roger Leigh on
On Sat, Oct 31, 2009 at 05:11:10AM -0700, Greg Stark wrote:
> On Mon, Oct 26, 2009 at 11:43 PM, Peter Eisentraut <peter_e(a)gmx.net> wrote:
> > On Mon, 2009-10-26 at 10:12 -0700, Greg Stark wrote:
> >> While i agree this looks nicer I wonder what it does to things like
> >> excel/gnumeric/ooffice auto-recognizing table layouts and importing
> >> files. I'm not sure our old format was so great for this so maybe this
> >> is actually an improvement I'm asking for. But as long as we're
> >> changing the format... It would at at least be good to test the
> >> behaviour
> >
> > What exactly are you referring to here?
>
> run something like this:
>
> $ psql
> stark=> \o /tmp/s
> stark=> select generate_series(1,10),generate_series(1,5);
> $ gnumeric /tmp/s&
> $ ooffice /tmp/s&
> $ kspread /tmp/s&
>
> With the 8.4 formatting gnumeric automatically guesses that | is the
> separator and formats the speadsheet quite reasonably. Open Office
> gets confused and opens the word processor, but if you do "insert
> sheet from file" and manually deselect the space and semicolon
> delimiters and put | as an "other" delimiter then it looks like it
> should work. I don't have kspread handy.
>
> Does gnumeric still autorecognize the new formats? Do the newline
> indicators in 8.4 mess up gnumeric? Are the new ones better or worse?
>
> This hasn't been a top priority in the past and the ReST discussion
> seemed to end up concluding that we shouldn't bother if we can't make
> it perfect. I'm not sure I agree with that, but in any case I think as
> long as we're changing the format we may as well check to see what the
> status is.

Surely if people want a machine-readable output format, they should
either

1) use libpq or one of its bindings, or
2) use a dedicated machine-readable output format such as CSV, which
is /designed/ for spreadsheet import.

The standard psql output formats (aligned, unaligned) are for
human-readable output and the others (latex, html, troff-ms) are
marked up for the respective tools. None of these are really
useful for other programs to parse.

Wouldn't it be much simpler all around to add a "csv" output format
in addition to the above for this purpose? Spreadsheets can read
it in with no trouble at all.


Regards,
Roger

--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
From: Andrew Dunstan on


Roger Leigh wrote:
>
> Wouldn't it be much simpler all around to add a "csv" output format
> in addition to the above for this purpose? Spreadsheets can read
> it in with no trouble at all.
>
>
>
>

We've had CSV output since version 8.0.

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Roger Leigh on
On Sat, Oct 31, 2009 at 12:25:22PM -0400, Andrew Dunstan wrote:
>
>
> Roger Leigh wrote:
>>
>> Wouldn't it be much simpler all around to add a "csv" output format
>> in addition to the above for this purpose? Spreadsheets can read
>> it in with no trouble at all.
>
> We've had CSV output since version 8.0.

Really? The only references I see are in tab-complete.c relating to
COPY.

You can set the field separator to ',' but you can't do a
\pset format csv
and get CSV with correct quoting, escaping etc AFAICS. It'll
still break on line wrapping if wrapping is enabled, and with
newlines in the data.

If that would be a useful addition, I can add it.


Regards,
Roger

--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
First  |  Prev  |  Next  |  Last
Pages: 4 5 6 7 8 9 10 11 12 13 14 15 16
Prev: Hot Standby 0.2.1
Next: Rejecting weak passwords