Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 6256A635E1B for ; Fri, 4 Dec 2009 12:58:50 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 42791-07 for ; Fri, 4 Dec 2009 16:58:40 +0000 (UTC) X-Greylist: delayed 00:05:02.602968 by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mail.postgresql.org (Postfix) with ESMTP id 536CC632724 for ; Fri, 4 Dec 2009 12:58:40 -0400 (AST) Received: from [10.0.0.142] ([213.164.88.233]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0LcC9p-1NzWY60p7d-00jDEm; Fri, 04 Dec 2009 17:53:36 +0100 Message-ID: <4B193E8E.6010603@kiss-net.de> Date: Fri, 04 Dec 2009 17:53:34 +0100 From: Uwe Maiwald User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: get sequence name from table name Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX19G8ywW5QqyKRuJt2TB2kJrmI7/el+1GgqTKky Z5HLlpdvoDmQ/DnzWbq/SHrwAOlwMNHzlA/1C3w9GMU6/udmze k1aOT1OsO3wSrz2dnG0JSWnDoNq7auf X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200912/7 X-Sequence-Number: 33445 how to get the name of the sequence that is responsible for setting the autoincrement value of a tables primary key column? i only have the name of the table and need to have an appropiate sql statement. i need this to write a program that loops through all tables of a database and then ajusts the start values of the sequencees in case the table has an automatic id value (serial/bigserial) thanks, Uwe