listing all tables

Started by Ryan Mchaleover 27 years ago5 messagesgeneral
Jump to latest
#1Ryan Mchale
sdecoop2@nortel.ca

Hi,

How would I list all tables in a database?

Ryan

#2Gene Selkov, Jr.
selkovjr@mcs.anl.gov
In reply to: Ryan Mchale (#1)
Re: [GENERAL] listing all tables

Ryan Mchale wrote:

Hi,

How would I list all tables in a database?

Ryan

second example in /usr/src/pgsql/src/tutorial/syscat.source

--Gene

#3Fandarel
fandarel@mail.solisys.com
In reply to: Gene Selkov, Jr. (#2)
Re: [GENERAL] listing all tables

How would I list all tables in a database?

You can list all tables with:

select * from pg_class;

but that will give you system tables also.

I think that if you use the \z command in psql, it will give you a list
of all tables in the current database.

Matt

#4Brian
signal@shreve.net
In reply to: Ryan Mchale (#1)
Re: [GENERAL] listing all tables

On 16 Jul 1998, Ryan Mchale wrote:

Hi,

How would I list all tables in a database?

psql database_name
\dt

Ryan

/-------------------------- signal@shreve.net -----------------------------\
| Brian Feeny | USR TC Hubs | ShreveNet Inc. (318)222-2638 |
| Network Administrator | Perl, Linux | Web hosting, online stores, |
| ShreveNet Inc. | USR Pilot | Dial-Up 14.4-56k, ISDN & LANs |
| 89 CRX DX w/MPFI, lots of |-=*:Quake:*=-| http://www.shreve.net/ |
| mods/Homepage coming soon |LordSignal/SN| Quake server: 208.206.76.47 |
\-------------------------- 318-222-2638 x109 -----------------------------/

#5Rostislav Matl
xmatl@informatics.muni.cz
In reply to: Fandarel (#3)
Re: [GENERAL] listing all tables

On 16-Jul-98 Fandarel wrote:

How would I list all tables in a database?

You can list all tables with:

select * from pg_class;

but that will give you system tables also.

I think that if you use the \z command in psql, it will give you a list
of all tables in the current database.

Matt

It's in docs even maybe in FAQs, or in archive - it was already discussed.

+-----------------------------------------------------------------------------+
|  ROSTISLAV MATL, student of Masaryk University - Faculty of Informatics     |
|  e-mail: xmatl@fi.muni.cz      WWW: http://www.fi.muni.cz/~xmatl/index.html | 
+-----------------------------------------------------------------------------+