Re: Getting Table Names in a Particular Database - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Getting Table Names in a Particular Database
Date
Msg-id CAOR=d=1bhUbULX++hVaexuBNmMnNCvqjPALzTaRvwyVnL2N3Gw@mail.gmail.com
Whole thread Raw
In response to Getting Table Names in a Particular Database  (Adarsh Sharma <adarsh.sharma@orkash.com>)
Responses Re: Getting Table Names in a Particular Database  (Scott Marlowe <scott.marlowe@gmail.com>)
Re: Getting Table Names in a Particular Database  (Adarsh Sharma <adarsh.sharma@orkash.com>)
List pgsql-general
On Tue, Aug 30, 2011 at 11:26 PM, Adarsh Sharma
<adarsh.sharma@orkash.com> 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.

pgsql-general by date:

Previous
From: Adarsh Sharma
Date:
Subject: Getting Table Names in a Particular Database
Next
From: Scott Marlowe
Date:
Subject: Re: Getting Table Names in a Particular Database