Search Postgresql Archives

Re: Getting Table Names in a Particular Database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 30, 2011 at 11:26 PM, Adarsh Sharma
<adarsh.sharma@xxxxxxxxxx> wrote:
> Dear all,
>
> Today I am researching about fetching all the table names in a particular
> database.
> There is \dt command but I need to fetch it from metadata.
> I find some commands as below :
>
> 1. SELECT table_name FROM information_schema.tables WHERE table_schema =
> 'public';
>
> 2. SELECT tablename FROM pg_tables WHERE tablename NOT LIKE ‘pg%’ AND
> tablename NOT LIKE ‘sql%’.
>
> But I need to specify a particular database & then fetch tables in that.

Try this, start psql with the -E switch, then run \d and copy and edit
the query(s) that gives you.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux