Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 4465E650227 for ; Wed, 23 Jul 2008 12:02:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 69858-04-3 for ; Wed, 23 Jul 2008 12:02:27 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.180]) by postgresql.org (Postfix) with ESMTP id 7FEAC650247 for ; Wed, 23 Jul 2008 12:02:10 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id d37so1366530pye.29 for ; Wed, 23 Jul 2008 08:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=JV75UQ34sYbBkyjvNLPa6DdBlH+TbdO8Ei+5/EVm7H8=; b=UeOQtMViVlhF3v5eIZLwt0/J5n6me9lvDejadpI65Deph833Kfh+sEb5PhkVIg9Wkk CdJzRX9m7BR8Zw03tygtlrYdUiFtVgRDTAlESMU6D0SQR0WQp30o0CodGnibd/XTwtrg tSiYC0yXT7/3bPFVUKIgFFdolNHIdTJV6rDVU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=tXIz4u3Z15BI7eci8y31Vi0MTidhMU4ko6lGr6v4+1nmabeFLjGrLiYEzcbzhNrvPR hniTqDaAuTM+EmTM732cg+1CSIoIF33iL2tF9/Xno8DRsX56M6hqUTdihQd2FCwLVKnt iXBL4a9f2dzzw3Zhfqbt3JIwZxbMJsGf6eLDY= Received: by 10.115.14.1 with SMTP id r1mr91970wai.206.1216825324000; Wed, 23 Jul 2008 08:02:04 -0700 (PDT) Received: by 10.114.130.17 with HTTP; Wed, 23 Jul 2008 08:02:03 -0700 (PDT) Message-ID: Date: Wed, 23 Jul 2008 09:02:03 -0600 From: "Scott Marlowe" To: "Campbell, Lance" Subject: Re: Query a list of tables Cc: pgsql-admin@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/192 X-Sequence-Number: 29802 On Wed, Jul 23, 2008 at 8:56 AM, Campbell, Lance wrote: > What is the SQL to do the following: > > > > 1) Return a list of all possible SCHEMA names within a database. > > 2) For a given SCHEMA return the list of all table names. You can either do it with the INFORMATION_SCHEMA, or the system catalogs. To see how to do it with the system catalogs, then start psql with the -E switch and issue \dn and set search_path='schemaname' and \d