Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id DDF946328FC for ; Tue, 31 Mar 2009 04:40:22 -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 60585-06 for ; Tue, 31 Mar 2009 04:40:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from imeil2.udg.edu (mailout10.udg.edu [84.88.128.10]) by mail.postgresql.org (Postfix) with ESMTP id 7D0C46323A6 for ; Tue, 31 Mar 2009 04:40:17 -0300 (ADT) Received: from sigte (besalu.udg.edu [84.88.143.241]) by imeil2.udg.edu (8.13.8/8.11.1/otb) with ESMTP id n2V7eFL0003474 for ; Tue, 31 Mar 2009 09:40:16 +0200 Received: from [84.88.143.14] (sig6.udg.edu [84.88.143.14]) by sigte (Postfix) with ESMTP id 083316373B for ; Tue, 31 Mar 2009 09:32:30 +0200 (CEST) Message-ID: <49D1C8CB.4000402@sigte.udg.edu> Date: Tue, 31 Mar 2009 09:39:55 +0200 From: =?ISO-8859-1?Q?toni_hern=E1ndez?= User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: copy command and column attribute References: <49D0D9BF.20407@sigte.udg.edu> <200903301740.05087.guillaume@lelarge.info> In-Reply-To: <200903301740.05087.guillaume@lelarge.info> 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: 200903/255 X-Sequence-Number: 31755 Thanks a lot Guillaume, It worked!! Guillaume Lelarge escribió: > Le lundi 30 mars 2009 à 16:39:59, toni hernández a écrit : > >> [...] >> 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) > FROM E'c://export_us_sg4.csv' with delimiter ',' csv quote as '"'; > > This should work better. > > >