supabase/postgres

PGDATA forced to default location

Closed this issue · 1 comments

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

The image forces PGDATA to be the default location: /var/lib/postgresql/data and fail it is overriden.
If the user defines PGDATA to another location, it is ignored and the container will fail starting.

Here is an output with PGDATA=/var/lib/postgresql/data/pgdata (NOTE the extra non standard /pgdata at the end):

 2025-05-27 09:00:49.140 UTC [1] FATAL:  "/var/lib/postgresql/data" is not a valid data directory

To Reproduce

You can test using docker and:

docker run --rm -it \
    -e PGDATA=/data \
    -e POSTGRES_PASSWORD=password \
     supabase/postgres:17.4.1.036 

It will fail mentioning:

 2025-05-27 09:25:05.745 UTC [49] FATAL:  data directory "/var/lib/postgresql/data" does not exist

which should not be relevant since we want to use /data.

Expected behavior

The user can point to a custom PGDATA and the container starts.
Using the original postgres image works fine:

docker run --rm -it \
    -e PGDATA=/data \
    -e POSTGRES_PASSWORD=password \
     postgres:latest

System information

  • version: supabase-postgres:17.4.1.036
    but the issue is not specific to this version.

Sorry for the DUP.
See #1611