Skip to content

Can't stop the postgresql service / Empty cluster name #922

@jorgeolive

Description

@jorgeolive

Hello,

When running the docker image by the default configuration, that is ,

docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres

No cluster information is associated to the database. When I try to stop the database service from within the container, I get the following error:

No PostgreSQL clusters exist; see "man pg_createcluster" ... (warning).

The postgresql services seems to be up afterwards:

root@ee8f239c3731:/etc/postgresql# sudo ps aux | grep postgres
postgres       1  0.0  0.1 213276 26636 ?        Ss   21:55   0:00 postgres
postgres      61  0.0  0.0 213396  7936 ?        Ss   21:55   0:00 postgres: checkpointer
postgres      62  0.0  0.0 213276  5876 ?        Ss   21:55   0:00 postgres: background writer
postgres      63  0.0  0.0 213276  9900 ?        Ss   21:55   0:00 postgres: walwriter
postgres      64  0.0  0.0 213812  8528 ?        Ss   21:55   0:00 postgres: autovacuum launcher
postgres      65  0.0  0.0  67868  4852 ?        Ss   21:55   0:00 postgres: stats collector
postgres      66  0.0  0.0 213712  6672 ?        Ss   21:55   0:00 postgres: logical replication launcher
root         600  0.0  0.0   6176   652 pts/0    S+   22:19   0:00 grep postgres

Seems there's no trace of the cluster name or whatsever. Indeed, running the following command returns no results:

root@ee8f239c3731:/# pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
root@ee8f239c3731:/#

or

postgres=# SELECT name, setting FROM pg_settings WHERE name in ('cluster_name','server_version','port');
      name      |            setting
----------------+--------------------------------
 cluster_name   |
 port           | 5432
 server_version | 14.1 (Debian 14.1-1.pgdg110+1)
(3 rows)

Is there anyway to start a containerized database with a given cluster name ?
Regards,
Jorge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions