Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 73E819FB6CE for ; Wed, 14 Mar 2007 11:45:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 68289-09 for ; Wed, 14 Mar 2007 11:45:30 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from zebedee.cranntara.net (zebedee.cranntara.net [91.186.7.79]) by postgresql.org (Postfix) with ESMTP id 915A89FB3B0 for ; Wed, 14 Mar 2007 11:45:36 -0300 (ADT) Received: from dial-dynamic-62-69-37-154.surfdial.murphx.net ([62.69.37.154] helo=bolek.coachhouse) by zebedee.cranntara.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.62) (envelope-from ) id 1HRUjM-0002cp-6R for pgsql-sql@postgresql.org; Wed, 14 Mar 2007 14:45:33 +0000 Received: from [192.168.0.32] (helo=[192.168.0.32]) by bolek.coachhouse with esmtp (Exim 4.50) id 1HRUjC-0004x2-PU for pgsql-sql@postgresql.org; Wed, 14 Mar 2007 14:45:22 +0000 Message-ID: <45F80A81.3010900@numerixtechnology.de> Date: Wed, 14 Mar 2007 14:45:21 +0000 From: T E Schmitz Reply-To: mailreg@numerixtechnology.de User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: import CSV file References: <45F70BC9.801@numerixtechnology.de> <20070313182740.ef40e742.darcy@druid.net> <45F73742.2080505@numerixtechnology.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/195 X-Sequence-Number: 27833 Rodrigo De León wrote: > On 3/13/07, T E Schmitz wrote: > >> This is pretty ingenious! >> Just a few minor problems: >> - how does COPY know which column is which? >> - how do I specify DELIMITER as TAB? > > > See: > http://www.postgresql.org/docs/8.2/static/sql-copy.html Thank you for the links. I had read of the manual entry for the COPY command and I know that I need something like psql -h lolek -U tes -d stockmarket -c "copy history from STDIN DELIMITER AS TAB CSV" < /tmp/FTSE.csv My problem is how to specify the tab character on the command line seeing as the COPY command is already enclosed in quotes. When creating CSV output I use -F $'\t' on Unix. However, DELIMITER AS $'\t' doesn't work. >> Also, it's nopt happy about the date format : 2007/02/09 > > See: > http://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-DATESTYLE -- Regards, Tarlika Elisabeth Schmitz