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

Re: Finding out table names

From: "tjk(at)tksoft(dot)com" <tjk(at)tksoft(dot)com>
To: kdnostr(at)california(dot)sandia(dot)gov (Kristen Nostrand)
Cc: pgsql-questions(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: Finding out table names
Date: 2000-04-19 20:22:48
Message-ID: 200004192022.NAA24872@uno.tksoft.com (view raw or flat)
Thread:
Lists: pgsql-sql
Kristen,

Here's what I use.

SELECT relname FROM pg_class WHERE relkind='r' and relname NOT LIKE 'pg_%' order by relname

Obviously, if you have tables which start with "pg_," then this solution
is not going to work. 

I don't know how orthodox this solution is, or whether there are 
serious problems with it. Maybe we'll find out now.


Troy





> 
> I'm doing some database programming using Java/JDBC.  I'd
> like to know how to find the table names contained in a
> database/schema.  Is there an SQL statement for doing that?
> 
> Kristen
> 


In response to

pgsql-sql by date

Next:From: Tim JohnsonDate: 2000-04-20 01:28:01
Subject: Re: GROUPING and ORDERING and CONFUSION
Previous:From: Kristen NostrandDate: 2000-04-19 19:10:49
Subject: Finding out table names

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