Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 254FC632A28 for ; Fri, 4 Dec 2009 15:24:49 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 91280-01 for ; Fri, 4 Dec 2009 19:24:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 207206327BA for ; Fri, 4 Dec 2009 15:24:37 -0400 (AST) Received: from perhan.alvh.no-ip.org (200-126-66-93.bk5-dsl.surnet.cl [200.126.66.93]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 5BD1F348034; Fri, 4 Dec 2009 11:24:36 -0800 (PST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 50A636EA88; Fri, 4 Dec 2009 16:24:34 -0300 (CLST) Date: Fri, 4 Dec 2009 16:24:34 -0300 From: Alvaro Herrera To: Uwe Maiwald Cc: pgsql-sql@postgresql.org Subject: Re: get sequence name from table name Message-ID: <20091204192434.GF4705@alvh.no-ip.org> References: <4B193E8E.6010603@kiss-net.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B193E8E.6010603@kiss-net.de> User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.543 tagged_above=-10 required=5 tests=AWL=0.056, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/11 X-Sequence-Number: 33449 Uwe Maiwald wrote: > how to get the name of the sequence that is responsible for setting > the autoincrement value of a tables primary key column? You can use the pg_get_serial_sequence() function. You need the name of the column in addition to the table name though. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.