Copying data from a tab delimited file into a table

From: Carol Walter <carol(dot)walter(at)sbcglobal(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Copying data from a tab delimited file into a table
Date: 2014-02-11 17:13:53
Message-ID: 5C8D060F-C97A-4BC9-B50F-F1384F55A2C3@sbcglobal.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I'm trying to copy the data from a tab delimited file into a postgres table. The table has a primary key that's designated as a serial data type. When I try to do the copy, it "blows up" unless I put a integer number in the field where the primary key will be. That defeats the purpose of designating this field as serial. When I put data into that field the copy works but an insert statement fails because it says there is a duplicate key. How can I get the data from this file into my table and still have the key field designated with a "serial data type"?

Thanks,
Carol

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message James David Smith 2014-02-11 17:16:22 Re: Copying data from a tab delimited file into a table
Previous Message Glyn Astill 2014-02-10 11:40:56 Re: Better Connection Statistics