Retrieving database schema

From: Gary M <postgres-general(at)mwwm(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Retrieving database schema
Date: 2003-03-23 03:33:29
Message-ID: Pine.LNX.4.44.0303222124210.25865-100000@ruby.gem
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From embedded SQL - how do I retrieve
1) a list of the tables in the datbase?
2) a list of the columns in each table?

Perhaps #1 is this:

SELECT tablename FROM pg_tables WHERE NOT schemaname = 'pg_catalog';

I'm at a loss for #2
The following doesn't seem very useful:

SELECT * FROM pg_class WHERE relname = 'tablename';

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2003-03-23 03:57:52 Re: Retrieving database schema
Previous Message Thomas T. Thai 2003-03-22 20:20:12 After Vacuum Analyze - ERROR: datumGetSize: Invalid typLen 0