Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id F2D94632CC3 for ; Thu, 8 Jul 2010 12:21:17 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 95810-05 for ; Thu, 8 Jul 2010 15:21:10 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id D4F1C63280F for ; Thu, 8 Jul 2010 12:21:10 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.4/8.14.4) with ESMTP id o68FL8qq084067 for ; Thu, 8 Jul 2010 12:21:09 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.4/8.14.4/Submit) id o68EvP6N049798 for pgsql-sql@postgresql.org; Thu, 8 Jul 2010 11:57:25 -0300 (ADT) (envelope-from news) From: =?ISO-8859-1?Q?Torsten_Z=FChlsdorff?= X-Newsgroups: pgsql.sql Subject: Re: strangest thing happened Date: Thu, 08 Jul 2010 16:57:28 +0200 Organization: A noiseless patient Spider Lines: 28 Message-ID: References: <201007071259.03294.johnf@jfcomputer.com> <4C34E764.3040703@joeconway.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 8 Jul 2010 14:57:29 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="AnkPUomeHXvuN7UdHvIkog"; logging-data="31598"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19G9yvZzSbr/wJrhFzuH4Xa" User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.5.0 In-Reply-To: <4C34E764.3040703@joeconway.com> Cancel-Lock: sha1:IWqn7IYjbaXeMfwWi1gJc69B/bc= To: pgsql-sql@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.79 tagged_above=-5 required=5 tests=BAYES_50=0.8, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/49 X-Sequence-Number: 34362 Joe Conway schrieb: >> I am the only developer, DBA etc.. for a small project. Today (yesterday was >> everything was perfect) many of the sequence numbers fell behind what is the >> actual PK value. For example the invoice PK sequence current value = 1056 >> but the table PK was 1071. Nobody (other than myself) knows how to >> edit/access the postgres server. So >> >> 1. Does anyone know how this could have happened?????? Other than human >> interaction. > > I've never heard of this happening. Are you certain nothing bypassed the > sequence and directly inserted a PK value? Maybe the sequence is defined with "cycle" and starts again? Very unlikly, but a possibility. Otherwise i would expect an bad backup/restore, direct insert of serials or manipulated them afterwards (by insert, update or an function). Gretings from Germany, Torsten -- http://www.dddbl.de - ein Datenbank-Layer, der die Arbeit mit 8 verschiedenen Datenbanksystemen abstrahiert, Queries von Applikationen trennt und automatisch die Query-Ergebnisse auswerten kann.