Strategy for Primary Key Generation When Populating Table

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Strategy for Primary Key Generation When Populating Table
Date: 2012-02-09 16:49:17
Message-ID: alpine.LNX.2.00.1202090843280.5256@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a lot of data currently in .pdf files. I can extract the relevant
data to plain text and format it to create a large text file of "INSERT INTO
..." rows. I need a unique ID for each row and there are no columns that
would make a natural key so the serial data type would be appropriate.

When I prepare the text file I can start each row with the delimiter (',')
to indicate there's a table column preceding. If I define the primary key
as serial type on that first position in the file, will postgres
automagically fill it in as each row is read into the table?

If not, or if there's a better way of approaching this task, please clue
me in to that.

TIA,

Rich

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2012-02-09 17:01:58 Re: Strategy for Primary Key Generation When Populating Table
Previous Message Chris Angelico 2012-02-09 15:59:09 Re: Warning: you don't own a lock of type ExclusiveLock