Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`psql` command to view all existing tablespaces?

What's the psql command to view all existing tablespaces?

\l+ displays all existing databases with their configured tablespace, but it won't display tablespaces which have been created but don't yet contain a database.

like image 870
sphere Avatar asked Mar 03 '23 19:03

sphere


2 Answers

As documented in the manual, the command to list tablespaces is \db

If you are looking for a command, just enter \? in the psql command line and it will show you all available commands including a short description.

like image 99
a_horse_with_no_name Avatar answered Mar 05 '23 17:03

a_horse_with_no_name


PSQL meta-command

\db+

SQL

SELECT * FROM pg_tablespace;
like image 23
Aashutosh Kumar Avatar answered Mar 05 '23 15:03

Aashutosh Kumar