Received: from wildbrain.com ([206.54.55.6]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6NH6Wf63500 for ; Mon, 23 Jul 2001 13:06:32 -0400 (EDT) (envelope-from dado@wildbrain.com) Received: from dadowin [207.44.242.179] by wildbrain.com [206.54.55.6] with SMTP (MDaemon.v2.8.7.4.R) for ; Mon, 23 Jul 2001 10:10:54 -0700 Message-ID: <007901c1139a$7ac337b0$b3f22ccf@dadowin> From: "dado feigenblatt" TO: CC: References: Subject: Re: Get the tables names? Date: Mon, 23 Jul 2001 10:10:42 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-MDaemon-Deliver-To: pgsql-sql@postgresql.org X-Return-Path: dado@wildbrain.com Reply-To: dado@wildbrain.com X-Archive-Number: 200107/316 X-Sequence-Number: 4129 ----- Original Message ----- From: "Joel Burton" To: "Dado Feigenblatt" Cc: "Magnus Landahl" ; "pgsql" Sent: Friday, July 20, 2001 1:43 PM Subject: Re: Get the tables names? > On Fri, 20 Jul 2001, Dado Feigenblatt wrote: > > > 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. > > system tables all ~ '^pg', which is probably a better check than > user=postgresql. > > > hth, > -- > Joel Burton > Director of Information Systems, Support Center of Washington You never know when someone will name their tables starting with "pg". Well, you never know when someone will create their tables as user postgres either.