Re: psql -f COPY from STDIN

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: Tarlika Elisabeth Schmitz <postgresql2(at)numerixtechnology(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: psql -f COPY from STDIN
Date: 2010-11-12 23:17:59
Message-ID: 4CDDCB27.9000004@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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 messages
> either):
>
> event.sql:
> COPY (event_id, event_name) FROM STDIN DELIMITER AS ',' NULL AS ''

COPY (event_id, event_name) FROM STDIN DELIMITER AS ',' NULL AS '';
^
>
> cat event.csv | psql -f event.sql
>
>
>
> What's the problem? Many thanks in advance.
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2010-11-13 03:22:11 Re: psql -f COPY from STDIN
Previous Message Tarlika Elisabeth Schmitz 2010-11-12 22:03:40 psql -f COPY from STDIN