Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id BBFE1127D32C for ; Wed, 16 Nov 2011 11:20:23 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 51260-03 for ; Wed, 16 Nov 2011 15:20:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 05774127D32E for ; Wed, 16 Nov 2011 11:20:18 -0400 (AST) Received: from [76.14.161.106] (helo=newserver.jfcomputer.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RQhHc-0001Wy-RL for pgsql-sql@postgresql.org; Wed, 16 Nov 2011 15:20:17 +0000 Received: from localhost (unknown [127.0.0.1]) by newserver.jfcomputer.com (Postfix) with ESMTP id EC0FB5846 for ; Wed, 16 Nov 2011 15:20:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at site Received: from newserver.jfcomputer.com ([127.0.0.1]) by localhost (linux-jfp8.site [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rciZZYGqVs4D for ; Wed, 16 Nov 2011 07:20:03 -0800 (PST) Received: from linux-desktop.localnet (unknown [192.168.1.143]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johnf@jfcomputer.com) by newserver.jfcomputer.com (Postfix) with ESMTPSA id 5D7125759 for ; Wed, 16 Nov 2011 07:20:03 -0800 (PST) From: John Fabiani Organization: J.F. Computer Solutions To: pgsql-sql@postgresql.org Subject: Re: updating a sequence Date: Wed, 16 Nov 2011 07:20:02 -0800 User-Agent: KMail/1.13.5 (Linux/2.6.34.10-0.2-desktop; KDE/4.4.4; i686; ; ) References: <201111150806.30911.johnf@jfcomputer.com> In-Reply-To: <201111150806.30911.johnf@jfcomputer.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201111160720.03018.johnf@jfcomputer.com> X-Host-Lookup-Failed: Reverse DNS lookup failed for 76.14.161.106 (failed) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201111/70 X-Sequence-Number: 36043 On Tuesday, November 15, 2011 08:06:30 am John Fabiani wrote: > Hi, > I have need of a statement that updates the sequence but uses a max() to > find the number. > > alter sequence somename restart with (select max(pk) from sometable). > > I need this for automating an ETL (using pentaho). > > Postgres 8.4 > > Thanks in advance, > Johnf Thanks everyone! Johnf