pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guillaume Lelarge <guillaume@lelarge.info>
To: pgsql-admin@postgresql.org
Cc: toni hernández <toni@sigte.udg.edu>
Subject: Re: copy command and column attribute
Date: Mon, 30 Mar 2009 17:40:04 +0200
Message-ID: <200903301740.05087.guillaume@lelarge.info> (raw)
In-Reply-To: <49D0D9BF.20407@sigte.udg.edu>
References: <49D0D9BF.20407@sigte.udg.edu>

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.


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com



view thread (3+ messages)  latest in thread

Message-ID: <200903301740.05087.guillaume@lelarge.info>
Permalink:  ../200903301740.05087.guillaume@lelarge.info/
Also on:    postgresql.org/message-id/200903301740.05087.guillaume@lelarge.info

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: guillaume@lelarge.info, toni@sigte.udg.edu
  Subject: Re: copy command and column attribute
  In-Reply-To: <200903301740.05087.guillaume@lelarge.info>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox