Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [GENERAL] getting list of tables from command line

From: Reece Hart <reece(at)harts.net>
Date: Wed Oct 31 2007 - 12:04:48 EDT


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


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match
Received on Wed Oct 31 13:20:43 2007

This archive was generated by hypermail 2.1.8 : Mon Jun 16 2008 - 19:09:13 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library