Parameter · Developer Options
allow_in_place_tablespaces
Allows tablespaces directly inside pg_tblspc, for testing.
- Default:
off - Type: bool
- Applies: Session (superuser)
In plain words
A tablespace is normally a directory somewhere else on disk, linked from pg_tblspc/ with a symbolic link. For tests that run a primary and a standby on the same machine, both would point at the same directory. This switch allows "in-place" tablespaces: a plain directory created inside the data directory itself.
For DBAs and operators
Captured on 18.6:
CREATE TABLESPACE tsx LOCATION '';ERROR: tablespace location must be an absolute pathWith the setting on, the same statement succeeds and pg_tablespace_location() returns the relative path pg_tblspc/24706, which is a real directory rather than a symlink.
It exists for the regression and TAP tests (replication of tablespaces on one host). Backup tools that expect symlinks in pg_tblspc may mishandle these directories. Recovery can also need it: if WAL replay creates such directories you may see a hint like Remove those directories, or set "allow_in_place_tablespaces" to ON transiently to let recovery complete.
Developer option: meant for debugging and testing PostgreSQL itself. Leave it at the default on production servers unless a specific diagnosis calls for it.
How to change it
A superuser (or a role granted SET) can change it per session with SET.