From: | "ezra epstein" <ee_newsgroup_post(at)prajnait(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | COPY FROM STDIN |
Date: | 2004-01-14 00:38:25 |
Message-ID: | mZicneGPgafWEpndXTWc-w@speakeasy.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I'm struggling using COPY FROM.
COPY ... FROM STDIN
expects stdin to be whatever file is being processed,
so:
$ cat data_file.txt | psql -f load_script.sql MyDB
Does not do what one would expect (and hope).
So we try the psql command:
\copy ... FROM 'data_file.txt'
and get:
psql:load_sricpt.sql:34: ERROR: literal newline found in data
HINT: Use "\n" to represent newline.
which gives a CONTEXT: of the last line of data --- hmmm, is that psql bug?
So we have to resort to:
\c - a_superuser
COPY ... FROM 'full_non_portable_path_to_our_data_file' ....
Which we would much rather avoid.
So,
(a) is there a way to indicate a different input stream for COPY STDIN ?
(b) is \copy broken on NT (cygwin) ?
== Ezra Epstein
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Bowden | 2004-01-14 00:40:19 | Re: serverless postgresql |
Previous Message | Nigel J. Andrews | 2004-01-14 00:17:37 | Re: Nested transaction - I am a bank ?? |