Re: (Mis?)Behavior of \copy with -f and \i

From: Mark Feit <mfeit+postgresql(at)notonthe(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: (Mis?)Behavior of \copy with -f and \i
Date: 2004-01-05 02:22:26
Message-ID: 16376.51810.33992.248263@gargle.gargle.HOWL
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut writes:
>
> [Patch to make psql's \copy read from the current input, not just
> the standard input or a file.]
>
> I'm not sure about the proposed syntax, but the feature sounds quite
> reasonable.

I have a patch written for this that uses the "-" syntax:

\copy junk (abbrev, name) FROM - WITH DELIMITER '|' NULL ''

I considered a half-dozen or so different ways to go about it, and
this one fits in without breaking anything that already exists. The
hyphen seems like the best choice to go with STDIN and STDOUT since
there are already other programs where it implies the default input
stream and it's not something likely to be found alone as a filename.
If you find something you like better, changing it to something else
is a matter of tweaking a string in copy.c.

The patch will be posted to pgsql-patches as soon as I've had a chance
to torture it some more.

- Mark
--
"Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it." -- Brian Kernighan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message A E 2004-01-05 03:26:23 Re: Anything akin to an Evaluate Statement in Postgresql?
Previous Message William ZHANG 2004-01-05 02:00:55 Re: psql \d option list overloaded