Re: [SQL] How do I get the list of table names in db - Mailing list pgsql-sql

From Maarten Boekhold
Subject Re: [SQL] How do I get the list of table names in db
Date
Msg-id Pine.SUN.3.91.980805152914.11433L-100000@dutepp2.et.tudelft.nl
Whole thread Raw
In response to How do I get the list of table names in db  (James Andrews <jamesa@darkplaces.com>)
List pgsql-sql
On Wed, 5 Aug 1998, James Andrews wrote:

> I need to know how to get a list of table names that exist in a particular
> database using Pg.  I know how to do it command line, but I need my scripts
> to be able to do it for error checking, and I haven't found a single doc on
> it.

select relname from pg_class where relkind='r' and relname !~ '^pg_'

relkind='r' gets all relations (tables) and relname!~'^pg_' excludes all
system tables.

Maarten

_____________________________________________________________________________
| TU Delft, The Netherlands, Faculty of Information Technology and Systems  |
|                   Department of Electrical Engineering                    |
|           Computer Architecture and Digital Technique section             |
|                          M.Boekhold@et.tudelft.nl                         |
-----------------------------------------------------------------------------


pgsql-sql by date:

Previous
From: Polášek Robert
Date:
Subject: Create view and group bz problems
Next
From: Sergei Barbarash
Date:
Subject: cursor results count