Re: List all tables from a specific database

From: Flaviu2 <flaviu2(at)yahoo(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, Ray O'Donnell <ray(at)rodonnell(dot)ie>
Subject: Re: List all tables from a specific database
Date: 2022-01-14 12:42:22
Message-ID: 1334065283.630213.1642164142702@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes, I started psql with -E, and now I see the SQL underhood. Thank you.
Now I need to find how to get and how to select a specific database, I have no experience in Postgre SQL. On Friday, January 14, 2022, 01:04:47 PM GMT+2, Ray O'Donnell <ray(at)rodonnell(dot)ie> wrote:

On 14/01/2022 10:39, Flaviu2 wrote:
> I work on a project that use Postgre SQL, and I have 0 experience in
> this regard. I hope to get help here. I need two SQL scripts for Postgre:
>
> 1. Get all databases, which I aquired already:
>
> *SELECT datname FROM pg_database WHERE datistemplate = false*
>
> This one is functional, it's ok.
>
> 2. Now, I need to find all tables *under a specific* database. This one
> I don't know how to achieve it. Can you help me here ? It is possible ?

If it's any help, running psql with the -E switch will show you the SQL
which psql generates... so then (within psql) issuing the \dt command to
list tables will show you the SQL used.

Ray.

--
Raymond O'Donnell // Galway // Ireland
ray(at)rodonnell(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ray O'Donnell 2022-01-14 12:45:49 Re: List all tables from a specific database
Previous Message Julien Rouhaud 2022-01-14 12:26:09 Re: List all tables from a specific database