Sunday, November 14, 2021

query/script to list tablespace in PostgreSQL:

 query to list tablespace in PostgreSQL:


SELECT spcname FROM pg_tablespace;



to  list all Tablespace in 


postgres=# \db

      

                                               List of tablespaces

    Name    |   Owner    |             Location              | Access privileges | Options |  Size  | Description

------------+------------+-----------------------------------+-------------------+---------+--------+-------------

 test_data  | test_admin | /opt/pgsql12/tablespace/test_data |                   |         | 59 GB  |

 pg_default | postgres   |                                   |                   |         | 35 MB  |

 pg_global  | postgres   |                                   |                   |         | 399 kB |


No comments:

Post a Comment