How to get table/DB info

From: Jeff Davis <jeff95350(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How to get table/DB info
Date: 2000-03-05 01:47:22
Message-ID: 20000305014722.20499.qmail@web3002.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This is a follow up to my previous question about this
subject.

I found out there are existing tables that hold all of
the info about a database. All of them begin with
'pg_'
(ie 'pg_tables'). You can use all of these tables in
combination to get the data you need about your
database. I have come up with some basic queries to
start getting some info. When I get done with all of
the queries to get the info equivilant to typing '\d
*' in psql I will publish them to this mailing list.
In the meantime, here is a simple query that shows how
to get all the table names and owners:
SELECT * FROM pg_tables WHERE tablename !~ '^pg_';

Hope it helps,
Jeff Davis

PS: you can get some help also by looking at the psql
source code, that is how I found out.
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Carbaugh 2000-03-05 02:11:12 RE: Help with installing 6.5.3 on RedHat6.1 - specifying template
Previous Message Timothy Glover 2000-03-05 00:44:52 Postgresql / Threads / Scalability