Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 91CE82E31D9 for ; Tue, 18 Dec 2007 13:38:13 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 25741-02 for ; Tue, 18 Dec 2007 13:38:05 -0400 (AST) Received: from smtp166.iad.emailsrvr.com (smtp166.iad.emailsrvr.com [207.97.245.166]) by postgresql.org (Postfix) with ESMTP id BE2942E3194 for ; Tue, 18 Dec 2007 13:38:06 -0400 (AST) Received: from relay6.relay.iad.emailsrvr.com (localhost [127.0.0.1]) by relay6.relay.iad.emailsrvr.com (SMTP Server) with ESMTP id 5FAA56EE739; Tue, 18 Dec 2007 12:38:05 -0500 (EST) Received: by relay6.relay.iad.emailsrvr.com (Authenticated sender: erik-AT-myemma.com) with ESMTP id 35B8A6E26AE; Tue, 18 Dec 2007 12:38:05 -0500 (EST) In-Reply-To: <20071218165836.4EFD42E004C@postgresql.org> References: <20071218165836.4EFD42E004C@postgresql.org> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <2C8AD9F2-4891-4D96-87D1-7101A180CC79@myemma.com> Cc: pgsql-sql@postgresql.org Content-Transfer-Encoding: quoted-printable From: Erik Jones Subject: Re: System catalog future changes Date: Tue, 18 Dec 2007 11:38:00 -0600 To: Steve Midgley X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/100 X-Sequence-Number: 29792 On Dec 18, 2007, at 10:53 AM, Steve Midgley wrote: > Hello again, > > Reading a previous recent post and answers called "Describe Table" =20 > got me thinking about a little piece of SQL I use in an application =20= > to get a list of all the tables for a specific namespace: > > select pg_class.relname as table_name > from pg_class > join pg_namespace on pg_namespace.oid =3D relnamespace > where pg_class.relkind =3D 'r' and pg_namespace.nspname =3D 'public' > order by pg_class.relname > > I have assumed that this sort of query would be relatively =20 > "durable" - that future system catalog changes are unlikely to make =20= > this query stop working? Does anyone have any knowledge of how =20 > "fixed" the columns and values of this query are (i.e. are there a =20 > lot of internal and external dependencies that make future Pg =20 > versiosn unlikely to break the above code)? > > Any other input on the above SQL - should I be doing this in =20 > another way? > > Thanks for any thoughts or advice, If all you're looking for is regular tables, the I'd use the =20 pg_tables view. Erik Jones Software Developer | Emma=AE erik@myemma.com 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. Visit us online at http://www.myemma.com