dbTalk Databases Forums  

List of tables

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss List of tables in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Marcel Wolf
 
Posts: n/a

Default List of tables - 01-28-2004 , 10:04 AM






Guys & Gals
What is the best way to get a list of tables in a database? Is there a
syntax for getting from the database after I connect or do I have to
query the System Catalog? Either way what would be the syntax? (Note :
Using PHP )

Thanks Again

Marcel Wolf


Reply With Quote
  #2  
Old   
George Weaver
 
Posts: n/a

Default Re: List of tables - 01-28-2004 , 10:33 AM






Hi Marcel,

Assuming you want just the tables you've created (and not a listing of system tables), you can use the following:

SELECT relname FROM pg_class WHERE relkind='r' AND relfilenode > (SELECTdatlastsysoid FROM pg_database WHERE datname = 'template0') ORDER BY relname;

Regards,
George
----- Original Message -----
From: Marcel Wolf
To: pgsql-novice (AT) postgresql (DOT) org
Sent: Wednesday, January 28, 2004 10:04 AM
Subject: [NOVICE] List of tables


Guys & Gals

What is the best way to get a list of tables in a database? Is there a syntax for getting from the database after I connect or do I have to query the System Catalog? Either way what would be the syntax? (Note : Using PHP )



Thanks Again



Marcel Wolf


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.