Re: Noob question: how to auto-increment index field on INSERT? - Mailing list pgsql-novice

From davemac
Subject Re: Noob question: how to auto-increment index field on INSERT?
Date
Msg-id 1298456558145-3396818.post@n5.nabble.com
Whole thread Raw
In response to Re: Noob question: how to auto-increment index field on INSERT?  (Ken MacDonald <drken567@gmail.com>)
List pgsql-novice
This could be due to the sequence being out of sync with the table itself.
Postgres uses the sequence to work out the id value to use for the new row.
The sequence should be the value of the id of the last row inserted in the
table. If the value of the sequence + 1 already exists in the table then you
will get this error. This all works by magic in Django provided the table
and the sequence match.
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Noob-question-how-to-auto-increment-index-field-on-INSERT-tp2141875p3396818.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

pgsql-novice by date:

Previous
From: Craig Barnes
Date:
Subject: Simple table creation
Next
From: "Mark Johnson"
Date:
Subject: PostgreSQL 9.0.3 on RHEL 5.6?