In this article, we will see how to install PostgreSQL 13 on Redhat.
PostgreSQL is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
In this article, we will see how to find PostgreSQL Server uptime through simple query. uptime is the difference between PostgreSQL start time and current time.
Lets connect to PostgreSQL Server and run the commands:
Get the PostgreSQL Server start time by using below command:
In this article, we are going to find out the top 10 tables in PostgreSQL Database by SQL query.
To get top 10 tables in PostgreSQL Server database:
SELECT table_name
,pg_relation_size(table_schema || '.' || table_name) as size
FROM information_schema.tables
WHERE table_schema NOT IN ('information_schema', 'pg_catalog')
ORDER BY size DESC
LIMIT 10;
To get top 5 tables in PostgreSQL Server database:
SELECT table_name
,pg_relation_size(table_schema || '.' || table_name) as size
FROM information_schema.tables
WHERE table_schema NOT IN ('information_schema', 'pg_catalog')
ORDER BY size DESC
LIMIT 5;