Skip site navigation (1) Skip section navigation (2)

SQL for listing the tables in a specific database

From: Lonni J Friedman <netllama(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: SQL for listing the tables in a specific database
Date: 2010-01-06 22:46:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
I've been googling for a while, and I can't seem to find a solution.
What I'd like to do is obtain a list of the tables that are part of a
specific database instance.  Google has provided me with numerous ways
of listing every table across all the database instances, but not a
way to isolate the dataset to just one database.

Here's what I've found thus far, which lists every table from every database:

select * from pg_tables
select table_name from information_schema.tables where table_schema = 'public' ;



pgsql-novice by date

Next:From: John J. UrbaniakDate: 2010-01-06 22:50:54
Subject: Re: Error on Vacuum?
Previous:From: Tom LaneDate: 2010-01-06 20:15:25
Subject: Re: Error on Vacuum?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group