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

Serial field

From: Francois Thomas <FrancoisT(at)alsdesign(dot)fr>
To: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Serial field
Date: 2001-07-12 16:44:44
Message-ID: 28B4376D3C8AD411960300D0B73C48461F577C@PROXY (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Hello to all

Unable to find an answer by searching the list archive, I ask my question
I want to migrate a database to PostgreSQL 6.5.2
I need an auto-increment field. I first tried the SERIAL type, but it
doesn't fit my needs.
In fact, I want to:
1/ keep the original INT value of my existing records from another server
(say, first row can be "1", second "3", next one "17",...)
2/ have an automatic incrementation of the last value for a new record. For
exemple, with the values above and a SERIAL field, the default value for a
new field would be "1" (first use of the sequence) instead of "18" (last
I hope my english is not too obscure !
Any advice will be welcome

Fran├žois THOMAS


pgsql-novice by date

Next:From: SuperDutyTA73Date: 2001-07-12 19:47:16
Subject: Best formal training for PostgreSQL use?
Previous:From: Jeroen HeijmansDate: 2001-07-12 09:06:42
Subject: Table type attributes

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