Skip site navigation (1) Skip section navigation (2)

Copy from problem

From: Eduardo Vázquez Rodríguez <evazquez(at)insys-corp(dot)com(dot)mx>
To: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Copy from problem
Date: 2004-05-24 17:54:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Hi I try to "copy from" a plain text file that looks someting like this:

John Red (\t) Garden Grove (\t) jwayne(at)garden(dot)com
Jessie Rodriguez (\t) West Beach
Jane Harrison (\t) Malibu (\t) jharrison(at)malibu(dot)com

Deliberately I missed the email info in the second line, I try to copy into
a table that has the following structure:

CREATE TABLE public."Example"
  "Name" varchar(30),
  "Adress" varchar(60),
  "Email" varchar(30),

When I issue the following command
copy public."Example" from '/home/postgres/abc.txt';

The following error appears

ERROR:  missing data for column "Email"
CONTEXT:  COPY Prueba, line 2: "Jessie Rodriguez	Santa Anna "

My question is how can I insert a null value into the field email,and that
copy from continue copying the next lines?


pgsql-novice by date

Next:From: Eduardo Vázquez RodríguezDate: 2004-05-24 17:59:48
Subject: Copy From problem
Previous:From: Rajan BhideDate: 2004-05-24 07:11:13
Subject: Re: !!URGENT!! Should I keep INDEX on the table?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group