Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f6NDxif66662 for ; Mon, 23 Jul 2001 09:59:44 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6KLVHa25564 for ; Fri, 20 Jul 2001 17:31:17 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f6KLEfd23799 for pgsql-sql@postgresql.org; Fri, 20 Jul 2001 17:14:41 -0400 (EDT) (envelope-from news) From: "Magnus Landahl" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Get the tables names? Date: Fri, 20 Jul 2001 23:14:40 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 62 Message-ID: <9ja701$n7l$1@news.tht.net> References: Reply-To: "Magnus Landahl" X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 To: pgsql-sql@postgresql.org X-Archive-Number: 200107/306 X-Sequence-Number: 4110 Hi Everybody!! Well I tried this (below) and it workt perfectly. Thanks a lot for ALL answers to my question! >select tablename from pg_tables where tablename not like 'pg_%'; Kind regards, Magnus Landahl "Joel Burton" skrev i meddelandet news:Pine.LNX.4.21.0107201642270.3206-100000@olympus.scw.org... > 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 > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster