Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 4A4549FB455 for ; Tue, 12 Jun 2007 03:31:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 97409-08 for ; Tue, 12 Jun 2007 03:31:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from p15105778.pureserver.info (p15105778.pureserver.info [217.160.133.184]) by postgresql.org (Postfix) with ESMTP id 35D029FB4F0 for ; Tue, 12 Jun 2007 03:31:12 -0300 (ADT) Received: by p15105778.pureserver.info (Postfix, from userid 65534) id 19C9C440D5; Tue, 12 Jun 2007 08:31:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by server1.proventis.net (Postfix) with ESMTP id 88B88C44292 for ; Tue, 12 Jun 2007 08:31:09 +0200 (CEST) Received: from server1.proventis.net ([127.0.0.1]) by localhost (server1.proventis.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08433-05 for ; Tue, 12 Jun 2007 08:31:09 +0200 (CEST) Received: from [192.168.22.130] (tmarkus.proventis.net [192.168.22.130]) by server1.proventis.net (Postfix) with ESMTP id 16845C44291 for ; Tue, 12 Jun 2007 08:31:09 +0200 (CEST) Message-ID: <466E3DAC.10209@proventis.net> Date: Tue, 12 Jun 2007 08:31:08 +0200 From: Thomas Markus Organization: proventis GmbH User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Sequence update function? References: <200706111825.56480.uwe@oss4u.com> In-Reply-To: <200706111825.56480.uwe@oss4u.com> Content-Type: multipart/mixed; boundary="------------060101010203080001010500" X-Virus-Scanned: by amavisd-new at proventis.net X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/99 X-Sequence-Number: 25767 This is a multi-part message in MIME format. --------------060101010203080001010500 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit do a select setval('sequence',max(col)+1) from tablename for each table tm Uwe C. Schroeder schrieb: > Hi, > > just thought I ask before I start doing it myself: Has anyone ever written a > stored procedure (or any other means) of syncing the sequence to the max # > key in the corresponding tables? > --------------060101010203080001010500 Content-Type: text/x-vcard; charset=utf-8; name="t.markus.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="t.markus.vcf" begin:vcard fn:Thomas Markus n:Markus;Thomas org:proventis GmbH adr:;;Zimmerstr. 79-80;Berlin;Berlin;10117;Germany email;internet:t.markus@proventis.net tel;work:+49 30 29 36 399 22 x-mozilla-html:FALSE url:http://www.proventis.net version:2.1 end:vcard --------------060101010203080001010500--