fertbus.blogg.se

Postgresql commands with examples
Postgresql commands with examples





postgresql commands with examples

This is the total disk space size used by the mentioned table including index and toasted data.

#Postgresql commands with examples how to

How to calculate postgreSQL table size in disk ? # SELECT pg_size_pretty(pg_database_size('geekdb')) If you want it to be shown pretty, then use pg_size_pretty function which converts the size in bytes to human understandable format. Pg_database_size is the function which gives the size of mentioned database. How to calculate postgreSQL database size in disk ? limit 1 – limits the output to display only one row.Ģ.pg_class – system table, which maintains the details of relations.relpages – relation pages ( number of pages, by default a page is 8kb ).If you want only the first biggest table in the postgres database then append the above query with limit as: # SELECT relname, relpages FROM pg_class ORDER BY relpages DESC limit 1 Test=# SELECT relname, relpages FROM pg_class ORDER BY relpages DESC

postgresql commands with examples

\g or terminate with semicolon to execute query Welcome to psql 8.3.7, the PostgreSQL interactive terminal. How to find the largest table in the postgreSQL database? $ /usr/local/pgsql/bin/psql test In this article let discuss about the 15 practical postgresql database commands which will be useful to both DBA and expert psql users.Īlso, refer to our previous article about 15 Practical PostgreSQL DBA Commands.ġ. Instead they may request the existing Oracle DBA, or Linux system administrator, or programmers to maintain the potgreSQL. To maintain those application, companies may not hire a fulltime postgreSQL DBA. Some of the open source application comes with postgreSQL database.







Postgresql commands with examples