Skip to content

Fix Postgres compose volume mount - #13

Draft
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-correctness-bugs-c060
Draft

Fix Postgres compose volume mount#13
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-correctness-bugs-c060

Conversation

@cursor

@cursor cursor Bot commented May 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Mount the pgdata named volume at Postgres' actual default data directory (/var/lib/postgresql/data).

Bug and impact

  • The compose service declared a persistent pgdata volume but mounted it at /var/lib/postgresql/data2 while the official Postgres image writes database files to /var/lib/postgresql/data by default.
  • Recreating the container could discard catalog database contents because the live database directory was stored in the container filesystem instead of the named volume.

Root cause

  • The volume path was changed away from Postgres' default PGDATA location without also setting PGDATA to match.

Fix and validation

  • Updated docker-compose.yml to mount pgdata at /var/lib/postgresql/data.
  • Validation: committed and pushed the change; verified the file contains the expected mount and no stale /data2 mount remains.
  • Note: docker compose config could not be run in this environment because Docker is not installed (docker: command not found).
Open in Web View Automation 

Co-authored-by: Bruno Medeiros <bruno.do.medeiros@gmail.com>
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.

1 participant