Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 9A36C632B23 for ; Thu, 8 Jul 2010 03:36:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 49316-10 for ; Thu, 8 Jul 2010 06:36:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com [209.85.161.46]) by mail.postgresql.org (Postfix) with ESMTP id 5B6CD632AAE for ; Thu, 8 Jul 2010 03:36:40 -0300 (ADT) Received: by fxm14 with SMTP id 14so173588fxm.19 for ; Wed, 07 Jul 2010 23:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=yiWA9rKcxXVVKwXDMB462BW4utlJRKMnxywM2Ko9HcA=; b=shWnxYj9pUY3Q6fb1c4nBEiDcab79FP5n5L/9iJ2xHJWAc+AIcwg+7UOTyLh32MAre VBpL9iYNfDWuIHhvHOh+YJgXfGdtomnPmozPoxiZdA0kFNJxwrQc7Avq86cgYNYias4h YEo+ULUbop33rRSCAoBHvkW9nzEnLUSHL23Hg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=t/KToPRBtkP3ISQ9k813ENkGRx+HPCbf7gPjMrZSfCk7VOoKT0mLrdY7mhE3o3FD58 EnZnpFiXXe9pjlsDWdQYTwFwQEnev99n5NvjbH+AEAaabrlJRdZOSZPE8euXQMgkLtwd Pc6EGE2EmNhk61Np4AxFkBGEuE/Zlq6WUvnno= MIME-Version: 1.0 Received: by 10.223.109.20 with SMTP id h20mr6705966fap.13.1278570995882; Wed, 07 Jul 2010 23:36:35 -0700 (PDT) Received: by 10.223.57.212 with HTTP; Wed, 7 Jul 2010 23:36:35 -0700 (PDT) In-Reply-To: <201007071259.03294.johnf@jfcomputer.com> References: <201007071259.03294.johnf@jfcomputer.com> Date: Thu, 8 Jul 2010 08:36:35 +0200 Message-ID: Subject: Re: strangest thing happened From: =?UTF-8?Q?Viktor_Bojovi=C4=87?= To: John Cc: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=001636eef00c079aef048ada8273 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.801 tagged_above=-5 required=5 tests=BAYES_50=0.8, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201007/41 X-Sequence-Number: 34354 --001636eef00c079aef048ada8273 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Jul 7, 2010 at 9:59 PM, John wrote: > 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 =3D = 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. > > 2. Does anyone have a script to reset the sequences to match the tables? > > Thanks in advance, > > Johnf > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > John, If the insert is performed to triggered table, and that trigger returns nul= l (doesn't insert) then the sequence will increment, but no data will be inserted. If needed I will send you some code examples where it happened to me many times. Sincerely --=20 --------------------------------------- Viktor Bojovi=C4=87 --------------------------------------- Wherever I go, Murphy goes with me --001636eef00c079aef048ada8273 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Wed, Jul 7, 2010 at 9:59 PM, John <johnf@jfcomputer= .com> wrote:
I am the only developer, DBA etc.. for a small project. =C2=A0Today (yester= day was
everything was perfect) many of the sequence numbers fell behind what is th= e
actual PK value. =C2=A0 For example the invoice PK sequence current value = =3D 1056
but the table PK was 1071. =C2=A0Nobody (other than myself) knows how to edit/access the postgres server. =C2=A0So

1. Does anyone know how this could have happened?????? Other than human
interaction.

2. Does anyone have a script to reset the sequences to match the tables?
Thanks in advance,

Johnf

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
= http://www.postgresql.org/mailpref/pgsql-sql


John,
If the insert is performed to triggered table, and that trigge= r returns null (doesn't insert) then the sequence will increment, but n= o data will be inserted. If needed I will send you some code examples where= it happened to me many times.

Sincerely
--
---------------------------------= ------
Viktor Bojovi=C4=87
---------------------------------------Wherever I go, Murphy goes with me
--001636eef00c079aef048ada8273--