Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id C12F21337B94 for ; Fri, 12 Nov 2010 19:06:43 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 94483-06 for ; Fri, 12 Nov 2010 23:06:36 +0000 (UTC) X-Greylist: delayed 00:37:29.770978 by SQLgrey-1.7.6 Received: from zebedee.cranntara.net (zebedee.cranntara.net [91.186.7.79]) by mail.postgresql.org (Postfix) with ESMTP id 551E31337B82 for ; Fri, 12 Nov 2010 19:06:36 -0400 (AST) Received: from [88.210.158.208] (helo=bolek.coachhouse) by zebedee.cranntara.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PH27A-0005HJ-Ny for pgsql-sql@postgresql.org; Fri, 12 Nov 2010 22:29:02 +0000 Received: from [192.168.0.32] (helo=dick.coachhouse ident=tarlika) by bolek.coachhouse with esmtp (Exim 4.69) (envelope-from ) id 1PH1ie-0006uf-7E for pgsql-sql@postgresql.org; Fri, 12 Nov 2010 22:03:40 +0000 Date: Fri, 12 Nov 2010 22:03:40 +0000 From: Tarlika Elisabeth Schmitz To: pgsql-sql@postgresql.org Subject: psql -f COPY from STDIN Message-ID: <20101112220340.36a0bc75@dick.coachhouse> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.12; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201011/21 X-Sequence-Number: 34759 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 '' cat event.csv | psql -f event.sql What's the problem? Many thanks in advance. -- Best Regards, Tarlika Elisabeth Schmitz