PostgreSQL tablespace recovery

A missing PostgreSQL tablespace can make one database—or the whole cluster—depend on an absent path.

PostgreSQL tablespaces place relations outside the main data directory and connect them through symbolic links under pg_tblspc. A failed mount, deleted link, missing storage volume, or copied cluster without external paths can leave required relation files unavailable.

Understand the symptom

A tablespace is part of the cluster's physical layout, not a portable folder of SQL tables.

WHY

What is happening

The pg_tblspc links reference version-specific subdirectories containing relation forks and segments. System catalogs map object IDs to those files, while WAL may include changes needed for consistency. Recovery must restore the correct path and content or reconstruct objects from a coherent cluster copy.

What you may see

Symptoms that change the recovery path.

01

Could not open directory pg_tblspc

The server follows a link whose target is absent or inaccessible.

02

Relation file does not exist

Catalog entries point to missing tablespace segments.

03

Cluster fails after storage migration

PGDATA moved, but external tablespace volumes or links did not.

04

One database produces I/O errors

Only objects assigned to the failed tablespace may be affected.

Protect the source

Actions that can make the situation worse.

01

Empty replacement paths hide missing data

The server may start but encounter absent relations or write new files into reused locations.

02

Link changes lose original mapping

Recreating symlinks without documenting targets obscures where each tablespace belonged.

03

Starting PostgreSQL advances WAL

Crash recovery and new transactions change cluster state.

Do this now

Safe steps before evaluation.

01

Stop PostgreSQL and clients

Prevent automatic restart, WAL replay, vacuum, and application writes.

02

Capture link and mount details

Record pg_tblspc link targets, device IDs, paths, permissions, and storage events.

03

Copy the full cluster set

Preserve PGDATA, tablespaces, pg_wal, configs, logs, and backups together.

04

Note exact version and extensions

Physical formats and required modules must match the recovery environment.

NEPFOSYS process

How a data-first evaluation proceeds.

01

Cluster-layout mapping

NEPFOSYS correlates catalogs, tablespace OIDs, links, external volumes, and relation files.

02

Protected consistency work

Candidate mounts and WAL state are tested against copies in a version-compatible environment.

03

Logical verification

Recovered databases, schemas, tables, indexes, and requested records are validated.

A clear next step

Preserve the original device before another repair or recovery attempt.

Start a case with the exact symptoms, incident timeline, prior attempts, encryption details, and the files that matter most. NEPFOSYS will route the case to the appropriate DFW intake or nationwide mail-in path.

Start with a case review

Questions, answered

What customers ask before starting.

Can I copy a tablespace into PGDATA?

Not casually. Catalog mappings, version directories, symlinks, permissions, and WAL consistency all matter.

Can PostgreSQL start without one tablespace?

It may fail or start with inaccessible objects depending on what the missing tablespace contains and the server state.

Should I recreate the symbolic link?

Only after preserving the original mapping and confirming the correct target content on a protected copy.

DFW local · Nationwide mail-in

Protect the device. Start with the facts.

Start my recovery case