Re: (Mis?)Behavior of \copy with -f and \i - Mailing list pgsql-hackers

From Mark Feit
Subject Re: (Mis?)Behavior of \copy with -f and \i
Date
Msg-id 16376.51810.33992.248263@gargle.gargle.HOWL
Whole thread Raw
In response to Re: (Mis?)Behavior of \copy with -f and \i  (Peter Eisentraut <peter_e@gmx.net>)
List 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 firstplace. Therefore, if you write the code as cleverly as
possible,youare, by definition, not smart enough to debug it."  -- Brian  Kernighan
 


pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: Remote Procedures
Next
From: A E
Date:
Subject: Re: Anything akin to an Evaluate Statement in Postgresql?