Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 84FE82E4873 for ; Thu, 10 Jan 2008 11:16:02 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 51042-02-3 for ; Thu, 10 Jan 2008 11:15:53 -0400 (AST) Received: from mtai02.charter.net (mtai02.charter.net [209.225.8.182]) by postgresql.org (Postfix) with ESMTP id 2F0BC2E4744 for ; Thu, 10 Jan 2008 11:13:02 -0400 (AST) Received: from aarprv04.charter.net ([10.20.200.74]) by mtai02.charter.net (InterMail vM.7.08.03.00 201-2186-126-20070710) with ESMTP id <20080110151240.NWDN19704.mtai02.charter.net@aarprv04.charter.net> for ; Thu, 10 Jan 2008 10:12:40 -0500 Received: from suse10-1.site ([68.186.33.18]) by aarprv04.charter.net with ESMTP id <20080110151240.JFM17353.aarprv04.charter.net@suse10-1.site> for ; Thu, 10 Jan 2008 10:12:40 -0500 From: johnf To: pgsql-admin@postgresql.org Subject: Re: find the sequence name from schema, table, field Date: Thu, 10 Jan 2008 07:12:39 -0800 User-Agent: KMail/1.9.6 (enterprise 20070904.708012) References: <200801092329.31115.jfabiani@yolo.com> <20080110141243.GB6465@alvh.no-ip.org> In-Reply-To: <20080110141243.GB6465@alvh.no-ip.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801100712.39496.jfabiani@yolo.com> X-Chzlrs: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/104 X-Sequence-Number: 27878 On Thursday 10 January 2008 06:12:43 am Alvaro Herrera wrote: > pg_get_serial_sequence But it only works with a serial data type. Create a sequence "mySequence" Create a field "myField smallint NOT NULL DEFAULT nextval('mysequence'::regclass)" So given the name of the table and the name of the field. How can I find the name of the associated squence? -- John Fabiani