Re: Appending \o output instead of overwriting the output file

From: "Brent Wood" <b(dot)wood(at)niwa(dot)co(dot)nz>
To: <pierce(at)hogranch(dot)com>, <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Appending \o output instead of overwriting the output file
Date: 2009-02-18 22:13:20
Message-ID: 499D3ED00200007B000194A0@gwia1.ham.niwa.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'd be happy with either...

>> is UNIX-ese for append, which is OK, & if anyone uses command line MSDOS/ command prompt, it does the same there. But if we are to follow this logic, the \o > file should overwrite/create, etc... which is perhaps a bit excessive.

I think that having \o write to a file and \o+ add to the file is simple & intutive for those folk who aren't familiar with the command line. The + means \o is adding to a file rather than just (over)writing a file, which I find pretty consistent with + in the other \ commands.

However, I think introducing a ">>" into \ syntax is new & different & quite inconsistent with the other \ commands.

But if either can be added I'll be happy :-) I'll just have to wait for Novell to formally support whichever version provides it, which shouldn't be much more than 3 years or so after it is released... At home I can use it straight away ...

Thanks,

Brent Wood

Brent Wood
DBA/GIS consultant
NIWA, Wellington
New Zealand
>>> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 02/19/09 10:19 AM >>>
John R Pierce <pierce(at)hogranch(dot)com> writes:
> Tom Lane wrote:
>> "Brent Wood" <b(dot)wood(at)niwa(dot)co(dot)nz> writes:
>>> Perhaps \o+ as a future fix for this?

>> I'd prefer "\o >>file" but maybe I'm too steeped in unix-isms.

> \o+ is reasonably consistent with the other \ command usages...

Not really; none of the other commands interpret + as meaning "append to
an existing file". They tend to take it as meaning "do something *in
addition to* what you normally do", not to do something that is
significantly different from the base command.

regards, tom lane

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

NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd.

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2009-02-18 22:13:50 Re: COPY questions
Previous Message Mike Christensen 2009-02-18 22:09:58 Postgres service fails to start on Windows 2003