Re: [SQL] psql -f COPY from STDIN

2010-11-13 Thread Tarlika Elisabeth Schmitz
On Sat, 13 Nov 2010 12:01:35 + Tarlika Elisabeth Schmitz wrote: >I'd like the store the COPY command in a separate file without >specifying an input file name. I want to feed it the data from the >shell script that calls psql "STDIN: All rows are read from the same source that issued the co

Re: [SQL] psql -f COPY from STDIN

2010-11-13 Thread Tom Lane
Tarlika Elisabeth Schmitz writes: > I changed event.sql (3 lines): > \COPY > (event_id, event_name) > FROM STDIN DELIMITER AS ',' NULL AS '' > Now I am getting error messages: > psql:event.sql:1: \copy:parse error at end of line I don't believe you can split backslash commands across lin

Re: [SQL] psql -f COPY from STDIN

2010-11-13 Thread Tarlika Elisabeth Schmitz
On Fri, 12 Nov 2010 22:22:11 -0500 Tom Lane wrote: >Tarlika Elisabeth Schmitz writes: >> The following command works fine when pasing it to psql via the -c >> option: > >> cat event.csv | \ >> psql -c "COPY (event_id, event_name) FROM STDIN DELIMITER AS ',' NULL >> AS ''" > >> When executed from

Re: [SQL] psql -f COPY from STDIN

2010-11-12 Thread Tom Lane
Tarlika Elisabeth Schmitz writes: > The following command works fine when pasing it to psql via the -c > option: > cat event.csv | \ > psql -c "COPY (event_id, event_name) FROM STDIN DELIMITER AS ',' NULL > AS ''" > When executed from a file via -f, it does nothing (no error messages > either):

Re: [SQL] psql -f COPY from STDIN

2010-11-12 Thread Adrian Klaver
On 11/12/2010 02:03 PM, Tarlika Elisabeth Schmitz wrote: The following command works fine when pasing it to psql via the -c option: cat event.csv | \ psql -c "COPY (event_id, event_name) FROM STDIN DELIMITER AS ',' NULL AS ''" When executed from a file via -f, it does nothing (no error message

[SQL] psql -f COPY from STDIN

2010-11-12 Thread Tarlika Elisabeth Schmitz
The following command works fine when pasing it to psql via the -c option: cat event.csv | \ psql -c "COPY (event_id, event_name) FROM STDIN DELIMITER AS ',' NULL AS ''" When executed from a file via -f, it does nothing (no error messages either): event.sql: COPY (event_id, event_name) FROM STD