X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5008352896 for ; Sat, 18 Jun 2005 11:05:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64799-09 for ; Sat, 18 Jun 2005 14:05:28 +0000 (GMT) Received: from biglumber.com (biglumber.com [207.228.252.42]) by svr1.postgresql.org (Postfix) with SMTP id 16E9452874 for ; Sat, 18 Jun 2005 11:05:27 -0300 (ADT) Received: (qmail 20556 invoked from network); 18 Jun 2005 14:05:32 -0000 Received: from unknown (HELO localhost) (207.228.252.42) by 0 with SMTP; 18 Jun 2005 14:05:32 -0000 From: "Greg Sabino Mullane" To: pgsql-admin@postgresql.org Cc: Stefan.Hortschitz@lfrz.at Cc: Stefan.Hortschitz@lfrz.at Subject: Re: failed insert into serial-type row X-PGP-Key: 2529 DF6A B8F7 9407 E944 45B4 BC9B 9067 1496 4AC8 X-Request-PGP: http://www.biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 In-Reply-To: Date: Sat, 18 Jun 2005 14:05:32 -0000 X-Mailer: JoyMail 1.48 Message-ID: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.125 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/148 X-Sequence-Number: 17903 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > and sometimes if i'm adding new rows to the table with statements like > this: > insert into (name,value) ('xy','xy'); Show us the actual SQL, not something "like" it. The above is not valid. > CREATE SEQUENCE session.preferences_id_seq > START 2487 You haven't shown us how this sequence is attached to the table. Presumably with: ALTER TABLE preferences ALTER id SET DEFAULT nextval('preferences_id_seq'); That START qualifier is a red flag. If the sequence was not created when the table was, one explanation is that there are existing values in the table that are higher than the current sequence. Running SELECT max(id) FROM preferences and SELECT * FROM preferences_id_seq; should show that. The other possibility is that someone is inserting into the table and specifying a value for the id field manually. - -- Greg Sabino Mullane greg@turnstep.com PGP Key: 0x14964AC8 200506180957 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iD8DBQFCtCoLvJuQZxSWSsgRAkiVAKDG6eVWdCdqzbnQnqIOHyoZ/ijzOACfcgh+ 9P9fUQbyJUXebzHvOf4F3Z8= =QKrK -----END PGP SIGNATURE-----