Changing ids conflicting with serial values?

From: Steven Brown <swbrown(at)ucsd(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Changing ids conflicting with serial values?
Date: 2005-11-03 01:00:48
Message-ID: dkbnfi$7g5$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

When I change an id (primary key serial) in a table, the next value
returned by the sequence for the id can conflict with that id (e.g.,
change the id to be id + 1). MySQL seems to handle this transparently
by skipping conflicting values, but with PostgreSQL I get primary key
conflicts. It seems rather bad if a user can modify an id in a row and
cause failures for all future inserts - it's just too fragile. What's
the proper way to handle this in PostgreSQL?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2005-11-03 01:49:42 Re: Data Dictionary generator?
Previous Message Steve Atkins 2005-11-03 00:58:48 Re: FOSS Reporting tools (was Oracle 10g Express - any danger for Postgres?)