Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
List all tables from a specific database - Mailing list pgsql-general
From
Flaviu2
Subject
List all tables from a specific database
Date
January 14, 2022
13:39:29
Msg-id
754992290.610416.1642156769536@mail.yahoo.com
Whole thread
Raw
Responses
Re: List all tables from a specific database
List
pgsql-general
Tree view
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 ?
For instance, using this SQL script:
SELECT 1, datname FROM pg_database WHERE datistemplate = false
I got:
mydb1
mydb2
postgres
So far, so good. Of course,
mydb1
and
mydb2
have been created by me, using:
create database mydb1
create database mydb2
Now, which SQL script to use, to retrieve all tables under a database only, but, most important,
using SQL script only
.
For instance, something like (
pseudo-script
):
SELECT table_name FROM information_schema.tables WHERE database = 'mydb1'
SELECT table_name FROM information_schema
.tables
WHERE database = 'mydb2'
Kindly thank you.
Flaviu.
pgsql-general
by date:
Previous
From:
Julien Rouhaud
Date:
14 January 2022, 13:23:55
Subject:
Re: [Extern] Re: postgres event trigger workaround
Next
From:
Ray O'Donnell
Date:
14 January 2022, 14:04:24
Subject:
Re: List all tables from a specific database
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies