pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff S. <pgsqluser@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: COPY isn't working right for me
Date: Tue, 13 Feb 2001 07:28:30 -0800 (PST)
Message-ID: <20010213152830.81634.qmail@web12709.mail.yahoo.com> (raw)

I have a tab delimited file that I'm trying to import
into an empty table.

I've set the table up as follows:

create table member (
member_id serial not null,
fname varchar(25) not null,
lname varchar(25) not null,
member_since date not null,
Primary Key (member_id)
);

My member.txt file looks like this:

Joe	Smith	2000/01/14
Frank	Jones	2000/06/21
Mike	Davis	2000/09/24

Here's the copy command I use:

COPY member FROM '/tmp/member.txt';

But I'm getting the following error:

ERROR:  copy: line 1, pg_atoi: error in "Joe": can't
parse "Joe"

I'm assuming this has to do with the member_id with
type serial.  How do I import into this without having
to add the OID's to each of the rows in the text file?



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/



view thread (2+ messages)  latest in thread

Message-ID: <20010213152830.81634.qmail@web12709.mail.yahoo.com>
Permalink:  ../20010213152830.81634.qmail@web12709.mail.yahoo.com/
Also on:    postgresql.org/message-id/20010213152830.81634.qmail@web12709.mail.yahoo.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: pgsqluser@yahoo.com
  Subject: Re: COPY isn't working right for me
  In-Reply-To: <20010213152830.81634.qmail@web12709.mail.yahoo.com>
  References: <20010213152830.81634.qmail@web12709.mail.yahoo.com>

* 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