Re: getting list of tables from command line

From: Reece Hart <reece(at)harts(dot)net>
To: Craig White <craigwhite(at)azapple(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: getting list of tables from command line
Date: 2007-10-31 16:04:48
Message-ID: 1193846688.6897.5.camel@snafu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2007-10-31 at 08:01 -0700, Craig White wrote:
> I wanted a way to
> query a database and get a text file with just the table names and
> cannot figure out a way to do that.

This should do the trick:

$ psql -Atc "select table_schema||'.'||table_name from
information_schema.tables"

-Reece

--
Reece Hart, http://harts.net/reece/, GPG:0x25EC91A0

In response to

Browse pgsql-general by date

  From Date Subject
Next Message T.J. Adami 2007-10-31 16:52:16 Re: Replacing RDBMS
Previous Message Scott Marlowe 2007-10-31 15:58:32 Re: Join between tables of two or more databases