# Impossibile aggiornare a PostgreSQL 15/

**URL:** <https://meta.discourse.org/t/unable-to-upgrade-to-postgresql-15/354397>\
**Category:** Self-hosting\
**Created:** [25 Febbraio 2025, 12:04pm UTC](https://meta.discourse.org/t/unable-to-upgrade-to-postgresql-15/354397 "2025-02-25T12:04:33Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![glorioustn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/glorioustn/32/490858_2.png) [@glorioustn](https://meta.discourse.org/u/glorioustn)\
**Post date:** [25 Febbraio 2025, 12:04pm UTC](https://meta.discourse.org/t/unable-to-upgrade-to-postgresql-15/354397/1 "2025-02-25T12:04:33Z")

</div>

Ciao, ho letto questo post: [PostgreSQL 15 update](https://meta.discourse.org/t/postgresql-15-update/349515) - e ho provato ad aggiornare alla versione 15, tuttavia quando eseguo il comando di ricostruzione, mi imbatto in errori che non conosco e nessuna delle mie ricerche ha risolto il problema. Apprezzerei qualsiasi aiuto potessi ricevere qui.

Si lamenta che sia Locale che postgres siano inizializzati dalla versione 13 e non siano compatibili con la 15.

```plaintext
WARNING: Docker version 20.10.7 deprecated, recommend upgrade to 24.0.7 or newer.
x86_64 arch detected.
WARNING: containers/app.yml file is world-readable. You can secure this file by running: chmod o-rwx containers/app.yml
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 600 app
app
2.0.20250129-0720: Pulling from discourse/base
Digest: sha256:01b8516e5504c0e9bc3707773015ff4407be03a89154194ff3b5b8699291bc26
Status: Image is up to date for discourse/base:2.0.20250129-0720
docker.io/discourse/base:2.0.20250129-0720
/usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2025-02-25T12:02:47.588312 #1] INFO -- : Reading from stdin
I, [2025-02-25T12:02:47.603317 #1] INFO -- : File > /etc/service/postgres/run chmod: +x chown:
I, [2025-02-25T12:02:47.608602 #1] INFO -- : File > /etc/service/postgres/log/run chmod: +x chown:
I, [2025-02-25T12:02:47.614271 #1] INFO -- : File > /etc/runit/3.d/99-postgres chmod: +x chown:
I, [2025-02-25T12:02:47.619607 #1] INFO -- : File > /root/install_postgres chmod: +x chown:
I, [2025-02-25T12:02:47.623993 #1] INFO -- : File > /root/upgrade_postgres chmod: +x chown:
I, [2025-02-25T12:02:47.624696 #1] INFO -- : Replacing data_directory = '/var/lib/postgresql/15/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-25T12:02:47.628520 #1] INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-25T12:02:47.629701 #1] INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-25T12:02:47.635680 #1] INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-25T12:02:47.636635 #1] INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-25T12:02:47.637658 #1] INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-25T12:02:47.638584 #1] INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-25T12:02:47.639215 #1] INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-25T12:02:47.639833 #1] INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-25T12:02:47.640892 #1] INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres peer in /etc/postgresql/15/main/pg_hba.conf
I, [2025-02-25T12:02:47.641570 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/15/main/pg_hba.conf
I, [2025-02-25T12:02:47.642114 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/15/main/pg_hba.conf
I, [2025-02-25T12:02:47.642818 #1] INFO -- : > if [-f /root/install_postgres]; then
  /root/install_postgres && rm -f /root/install_postgres
elif [-e /shared/postgres_run/.s.PGSQL.5432]; then
  socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
fi

failed to set locale!
[error] character map file `UTF-8' not found: No such file or directory
failed to set locale!
[error] default character map file `ANSI_X3.4-1968' not found: No such file or directory
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US.UTF-8",
        LC_ALL = "en_US.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
popen failure: Cannot allocate memory
initdb: error: program "postgres" is needed by initdb but was not found in the same directory as "/usr/lib/postgresql/15/bin/initdb"
I, [2025-02-25T12:02:49.979779 #1] INFO -- : Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.
Upgrading PostgreSQL from version 13 to 15

I, [2025-02-25T12:02:49.980481 #1] INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/15/bin/postmaster -D /etc/postgresql/15/main
I, [2025-02-25T12:02:49.983148 #1] INFO -- : Terminating async processes
2025-02-25 12:02:50.007 UTC [51] FATAL: database files are incompatible with server
2025-02-25 12:02:50.007 UTC [51] DETAIL: The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 15.10 (Debian 15.10-1.pgdg120+1).

```

Grazie in anticipo!

---

_[View the full topic](https://meta.discourse.org/t/unable-to-upgrade-to-postgresql-15/354397)._
