<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tablespaces on Postgres Scripts</title><link>https://www.postgresscripts.com/tags/tablespaces/</link><description>Recent content in Tablespaces on Postgres Scripts</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>PostgresScripts.com</copyright><lastBuildDate>Fri, 03 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.postgresscripts.com/tags/tablespaces/index.xml" rel="self" type="application/rss+xml"/><item><title>Query PostgreSQL Tablespace Info with pg_tablespace</title><link>https://www.postgresscripts.com/post/query-postgresql-tablespace-info-pg-tablespace/</link><pubDate>Fri, 03 Jul 2026 00:00:00 +0000</pubDate><guid>https://www.postgresscripts.com/post/query-postgresql-tablespace-info-pg-tablespace/</guid><description>
&lt;h2 id="query-postgresql-tablespace-info-with-pg_tablespace"&gt;Query PostgreSQL Tablespace Info with pg_tablespace&lt;/h2&gt;
&lt;p&gt;What tablespaces exist in this cluster, who owns each one, and where do their files actually live on disk? &lt;code&gt;pg_tablespace&lt;/code&gt; answers all three: it holds one row per tablespace with the owner OID, access control list, storage options, and — via &lt;code&gt;pg_tablespace_location()&lt;/code&gt; — the on-disk path, all readable from a single catalog query without parsing configuration files or tracing symlinks by hand.&lt;/p&gt;
&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1012089347386563"
crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1012089347386563"
data-ad-slot="7945792173"
data-ad-format="auto"
data-full-width-responsive="true"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;h2 id="purpose-and-overview"&gt;Purpose and Overview&lt;/h2&gt;
&lt;p&gt;Tablespaces are PostgreSQL's mechanism for controlling where data files land on disk. Every cluster starts with two built-in spaces: &lt;code&gt;pg_default&lt;/code&gt;, which holds user tables and indexes, and &lt;code&gt;pg_global&lt;/code&gt;, which holds the cluster-wide system catalogs. Additional tablespaces appear when a DBA runs &lt;code&gt;CREATE TABLESPACE&lt;/code&gt; pointing at a different mount point — typically a faster SSD volume for a hot OLTP schema, a slower spinning disk for archive data, or a dedicated volume to isolate write-amplification from MVCC-heavy tables.&lt;/p&gt;</description></item></channel></rss>