Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 8F881635F29 for ; Mon, 30 Mar 2009 12:40:15 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 55808-01-10 for ; Mon, 30 Mar 2009 12:40:12 -0300 (ADT) Received: from mx1.hub.org (mx1.hub.org [200.46.208.106]) by mail.postgresql.org (Postfix) with ESMTP id 358096358F9 for ; Mon, 30 Mar 2009 12:40:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-2317.dedibox.fr (sd-2317.dedibox.fr [88.191.17.192]) by mx1.hub.org (Postfix) with ESMTP id D9878125AA7A for ; Mon, 30 Mar 2009 12:40:09 -0300 (ADT) Received: from laptop.localnet (ASte-Genev-Bois-153-1-66-208.w86-198.abo.wanadoo.fr [86.198.36.208]) by sd-2317.dedibox.fr (Postfix) with ESMTPA id 6BA272303; Mon, 30 Mar 2009 17:40:06 +0200 (CEST) From: Guillaume Lelarge To: pgsql-admin@postgresql.org Subject: Re: copy command and column attribute Date: Mon, 30 Mar 2009 17:40:04 +0200 User-Agent: KMail/1.11.1 (Linux/2.6.27-14-generic; KDE/4.2.1; i686; ; ) Cc: toni =?iso-8859-1?q?hern=E1ndez?= References: <49D0D9BF.20407@sigte.udg.edu> In-Reply-To: <49D0D9BF.20407@sigte.udg.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200903301740.05087.guillaume@lelarge.info> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/250 X-Sequence-Number: 31750 Le lundi 30 mars 2009 =E0 16:39:59, toni hern=E1ndez a =E9crit : > [...] > I've been trying to import some data from a csv file to my database. > I have some fields of the table that I want to keep so I typed > > copy mytable (column > Affidabilita_stratigrafica,Ambiente,Anno,Componenti_geologici) FROM > E'c://export_us_sg4.csv' with delimiter ',' csv quote as '"'; > > This way I expect some fields to remain with the default value, but an > error appears near "column" > > Am I typing it wrong? Yes, there should be no COLUMN keyword in this statement. copy mytable (Affidabilita_stratigrafica,Ambiente,Anno,Componenti_geologici) =46ROM E'c://export_us_sg4.csv' with delimiter ',' csv quote as '"'; This should work better. =2D-=20 Guillaume. http://www.postgresqlfr.org http://dalibo.com