Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I list all tables under my schema 1

Status
Not open for further replies.

wengyan

IS-IT--Management
Jan 8, 2002
30
CN
As a novice of PostgreSQL,Could anyone help me?

WENG YAN
 
how do you want to list them? using psql, or you want to create a program that lists them?

(for psql there are short commands for that)

for all the cases you can use information_schema
the tables are in information_schema.tables

just try select * from information_schema.tables ; and you will see all the tables you can then filter them by schema
 
Thanks for your help.
I'm interested in the short commands which could help me manage the database more effectively,could you teach me more? ^_^
For instance, If I want to list the table structure, how could I go in PostgreSQL like desc command in Oracle?


WENG YAN
 
I met another problem. My version of PostgreSQL is 8.1.
The database's encoding is UTF8.
When I input \d command,it tell me an exception raised as below:
Code:
Users=> \d
ERROR:  invalid UTF-8 byte sequence detected near byte 0xb1

Is it related with my database's encoding?

WENG YAN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top