# allow_in_place_tablespaces

> allow_in_place_tablespaces — Allows tablespaces directly inside pg_tblspc, for testing. Observed in PG10–19 Beta 3; its last measured boot default is off in PG19 Beta 3, with superuser context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
---

> [!NOTE]
> **Fact — official short description:** “Allows tablespaces directly inside pg_tblspc, for testing.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `bool` | Upstream pg_settings type |
| Context | `superuser` | Settable at runtime by a superuser |
| Unit | — | Raw unit |
| Range | — | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Developer Options | Upstream classification |
| Latest boot value | `off` | off |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG10 |
| Present in | PG10–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`7bdbbb87340f`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=7bdbbb87340f4cb9f262320a28be8f87d4c38308) — Allow "in place" tablespaces. |
| Commit date | 2022-07-27 |
| Discussion | [thread 1](https://postgr.es/m/20220722081858.omhn2in5zt3g4nek@alvherre.pgsql) |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG10–19 Beta 3 | `off` | — | off |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

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.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| 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. |
| 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. |
| Small nodes | Keep allow_in_place_tablespaces at its upstream default. A small host has less spare CPU, disk, connection, and log capacity for developer instrumentation. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

| Template | Effective value | Versus upstream boot | Source expression |
| --- | --- | --- | --- |
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG10–19 Beta 3 unmodified; OLAP: PG10–19 Beta 3 unmodified; CRIT: PG10–19 Beta 3 unmodified; TINY: PG10–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- 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.

## Related parameters {#related-parameters}

[`data_directory`](/parameters/data-directory/) · [`wal_level`](/parameters/wal-level/) · [`hot_standby`](/parameters/hot-standby/) · [`archive_mode`](/parameters/archive-mode/)

## References {#references}

- [PostgreSQL 19 Beta 3 — allow_in_place_tablespaces](https://www.postgresql.org/docs/19/runtime-config-developer.html#GUC-ALLOW-IN-PLACE-TABLESPACES)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
