select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

CONFIGURATION / DEVELOPER OPTIONS

allow_in_place_tablespaces

Read PG 18 manual ↗

Allows tablespaces to be created as directories inside pg_tblspc, when an empty location string is provided to the CREATE TABLESPACE command.

Type
bool
Context
superuser
Measured default
off
Unit
Metadata snapshot
18

Definition PG 18 manual

Allows tablespaces to be created as directories inside pg_tblspc, when an empty location string is provided to the CREATE TABLESPACE command. This is intended to allow testing replication scenarios where primary and standby servers are running on the same machine. Such directories are likely to confuse backup tools that expect to find only symbolic links in that location. Only superusers and users with the appropriate SET privilege can change this setting.

Measured default history
Version intervalDefault
10 – 19off
Analysis & operational context

Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗

How it works

allow_in_place_tablespaces lets a superuser create a tablespace with an empty location directly under pg_tblspc instead of using the normal external-location symbolic link. It exists to test primary and standby instances on one machine.

The directory layout violates assumptions made by backup and tablespace-management tools, which normally expect pg_tblspc entries to be links. It does not make colocated tablespaces independent storage.

The switch is consulted for the privileged CREATE TABLESPACE operation and is not a performance setting. Objects created this way can remain after the setting is turned off. Its superuser context permits an authorized session change without a server restart.

Operational considerations

Leaving allow_in_place_tablespaces enabled after the bounded diagnostic or recovery task.

Running the experiment on the only copy of production data.

Underestimating log, core-file, temporary-file, WAL, CPU, or connection-slot amplification.

Treating a server that merely starts or completes a query as proof that data and behavior are correct.

Workload guidance

OLAP: Long analytical runs can amplify allow_in_place_tablespaces's debug overhead and artifacts. Prefer standard EXPLAIN and statistics first, and isolate any developer experiment from normal users.

OLTP: Do not tune production OLTP with allow_in_place_tablespaces. Enable it only for a bounded reproduction with an owner, log/disk budget, rollback condition, and evidence-capture plan; restore the default immediately afterward.

SMALL: Keep allow_in_place_tablespaces at its upstream default. A small host has less spare CPU, disk, connection, and log capacity for developer instrumentation.

Version history 2
  1. PG 14 → 15changed
  2. PG 9.6 → 10added

Related entries

Further reading

Definition snapshot: english-manuals:82e1821ef46ebece672affe3ebe… · English manual source