Skip to content

Fix: PostgreSQL 18 PGDATA path (initdb fails with old /data path) - #1

Open
sandvale wants to merge 1 commit into
sailboxhq:mainfrom
sandvale:fix/postgres18-pgdata-path
Open

Fix: PostgreSQL 18 PGDATA path (initdb fails with old /data path)#1
sandvale wants to merge 1 commit into
sailboxhq:mainfrom
sandvale:fix/postgres18-pgdata-path

Conversation

@sandvale

Copy link
Copy Markdown

Summary

PostgreSQL 18 changed its default data directory structure.
The Sailbox installer still mounts /var/lib/postgresql/data, which causes initdb to fail and PostgreSQL never starts.

Problem

The official PostgreSQL 18 Docker image no longer uses /var/lib/postgresql/data.
Data is now initialized under:

/var/lib/postgresql

Because the installer mounts the old path, the container starts but PostgreSQL immediately exits with an initialization error.

Fix

Updated the docker-compose template to mount the correct directory:

Before:

  • sailbox_pgdata:/var/lib/postgresql/data

After:

  • sailbox_pgdata:/var/lib/postgresql

Result

After applying this fix, PostgreSQL initializes correctly and Sailbox starts without errors.

Environment

@sandvale

Copy link
Copy Markdown
Author

This PR fixes the PostgreSQL 18 initialization issue by updating the PGDATA mount path.
Postgres 18 no longer uses /var/lib/postgresql/data, so the installer fails without this change.

@ZhonFortune

Copy link
Copy Markdown

same issue. But the author seems like no longer maintenance this project ever

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants