Where in the DB is the Location of a postgres tablespace stored
Use pg_tablespace_location(tablespace_oid)
(PostgreSQL 9.2+) to get the path in the file system where the tablespace
is located.
You'll get oid
of tablespace
from pg_tablespace
, so the query should be
select spcname
,pg_tablespace_location(oid)
from pg_tablespace;
Another super easy command to list all table spaces
\db+
This will provide you all table space details very quick