Received: from flip.wildbrain.com ([206.54.55.32]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6KK0Va92178 for ; Fri, 20 Jul 2001 16:00:31 -0400 (EDT) (envelope-from dado@wildbrain.com) Received: from wildbrain.com (daedelus.wildbrain.com [192.168.1.38]) by flip.wildbrain.com (8.9.3/8.9.3) with ESMTP id LAA06401; Fri, 20 Jul 2001 11:57:43 -0700 Message-ID: <3B588D48.80803@wildbrain.com> Date: Fri, 20 Jul 2001 12:58:00 -0700 From: Dado Feigenblatt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010628 X-Accept-Language: en-us MIME-Version: 1.0 To: Magnus Landahl , pgsql Subject: Re: Get the tables names? References: <9j67ra$m1$1@news.tht.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200107/285 X-Sequence-Number: 4088 Magnus Landahl wrote: >Hi everybody! > >Is it possible to get the names of all tables in the database with a sql >query?? > >Best regards, > >Magnus > > > >---------------------------(end of broadcast)--------------------------- >TIP 3: if posting/reading through Usenet, please send an appropriate >subscribe-nomail command to majordomo@postgresql.org so that your >message can get through to the mailing list cleanly > > > Not sure if this is the best way, but it works. SELECT relname , relowner from pg_class where relkind = 'r'; The only thing is that this includes system tables. So if you want to strip those you need to SELECT relname , relowner FROM pg_class WHERE relkind = 'r' and relowner != 26; Is user postgres always 26? Maybe you have to find that out first. -- Dado Feigenblatt Wild Brain, Inc. Technical Director (415) 553-8000 x??? dado@wildbrain.com San Francisco, CA.