Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 356706503DE for ; Wed, 19 Nov 2008 12:43:11 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 06847-02-4 for ; Wed, 19 Nov 2008 12:43:05 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.184]) by mail.postgresql.org (Postfix) with ESMTP id C5D55650220 for ; Wed, 19 Nov 2008 12:40:55 -0400 (AST) Received: by gv-out-0910.google.com with SMTP id i36so24445gve.7 for ; Wed, 19 Nov 2008 08:40:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=y9cKm8BpTV5ugHbHMhbDCEUxI1IIk3F6QJfnAHLzw0U=; b=fHH7WnEEVf8PAMVcAxNIQgYhd74K0PLL8uLXUJHpXdpwJ1rB88XCVHULDwA4MNhoZk 8AxPAA93yv/4X9rHKsAjliorThdd1W/EGAB2FAeI6vaBu5x37FYaiAQLJXqgyI6lSD4W 63xCl5RMmWa8BDDpcOcTlyiAb7MVotJOf7rLQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=hdi+H/p6fQfz2qzZFiRyXGwz+M/nt95AjpKZCMqmFpSYKQwqdf9wjePR2sgqLII1xg XrCs/VbT6Q2viZQB01WR6Xx1UDS5GW55xZepeoX1VAm6CrMeHJ2JBDvL0P3kvZKiIzVQ 1gUqOxsutXpgbClU88N4VPL5FDkAdDYxHYiqg= Received: by 10.103.2.14 with SMTP id e14mr431830mui.94.1227112852871; Wed, 19 Nov 2008 08:40:52 -0800 (PST) Received: by 10.102.247.18 with HTTP; Wed, 19 Nov 2008 08:40:52 -0800 (PST) Message-ID: Date: Wed, 19 Nov 2008 11:40:52 -0500 From: "Merlin Moncure" To: "=?WINDOWS-1252?Q?Kranti=99_K_K_Parisa?=" Subject: Re: [PERFORM] Very Urgent : Sequences Problem Cc: pgsql-admin@postgresql.org, pgsql-performance@postgresql.org In-Reply-To: <4478b4ac0811190754n42d9539v4bd42350fac24d1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <4478b4ac0811190754n42d9539v4bd42350fac24d1@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/115 X-Sequence-Number: 30769 On Wed, Nov 19, 2008 at 10:54 AM, Kranti=99 K K Parisa wrote: > Hi, > > I have defined sequence on a table something like this > > > CREATE SEQUENCE items_unqid_seq > INCREMENT 1 > MINVALUE 0 > MAXVALUE 9223372036854775807 > START 7659 > CACHE 1; > > this is on a table called items. where i have currently the max(unq_id) a= s > 7659. > > and in the stored procedure when i am inserting values into the items tab= le > for the unq_id column i am using the sequence as follows: > > nextval('items_unqid_seq'::text) > > > it seems to be working some times. and the sequences are not getting upda= ted > sometime. which is casuing primary key exceptions. > > please advise as soon as possible. > > is there any trivial problem with sequences in postgresql?? no (at least none that I know of). maybe if you posted the source of your procedure? I bet your error is coming form some other source. merlin