Received: from griffin.geeknet.cz (griffin.geeknet.cz [88.146.116.75]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id C144221F9CB for <~alpine/users@lists.alpinelinux.org>; Tue, 17 Mar 2026 15:09:46 +0000 (UTC) Received: by griffin.geeknet.cz (OpenSMTPD) with ESMTP id 91c22d3a; Tue, 17 Mar 2026 16:09:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=jirutka.cz; h=message-id :subject:from:to:date:in-reply-to:references:content-type :content-transfer-encoding:mime-version; s=dk2022; bh=PYoMtj7iLD uxclJHo0k5DYZS9fC+6lfYh//upuYFUZc=; b=mVvhvcoLYDH9gPcuo6X6Z2lxLD 2eblftHOITtBFYrgv50aq0FuzxkPQ9/x1ghjRTr4n1akK/44W8rDFUp03JKx25S8 IbLP5BjwYDGfZLO/d6dWDT6EkyLUuAtZBlvr46sDM2h5b8vBzbjg8VU+fQ9Bnvae sh9JPkkiCpdMI3TX02hb7xDhDBxr2wDCzzwjOCS1rCdQQTwy/gwX1rCNi/QDnYg2 xkLasUun4GXHhDLjNEEHczWAC+OQXSQ6a84d6XaE4Is2g+lb/NnjRJCt3q0dQQKs WBuXvPX7xsOUrY20R6joTuuCoBMiKaOT7BCqgTd2SAfe4wqxvL4tJ6WEdvOQ== Received: by griffin.geeknet.cz (OpenSMTPD) with ESMTPSA id 794fb3d4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 17 Mar 2026 16:09:44 +0100 (CET) Message-ID: Subject: Re: Upgrading PostgreSQL 17 to 18 with pg_upgrade: "This utility can only upgrade to PostgreSQL version 18." From: Jakub Jirutka To: revsuine , ~alpine/users@lists.alpinelinux.org Date: Tue, 17 Mar 2026 16:09:44 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (by Flathub.org) MIME-Version: 1.0 Hi, I just tried to replicate your steps and it works on my system. Can you verify that /usr/libexec/postgresql is a symlink to /usr/libexec/postgresql18 after running `pg_versions set-default 18` and th= at /usr/bin/initdb is a symlink to /usr/libexec/postgresql/initdb? Can you verify that /var/lib/postgresql/18/data/PG_VERSION contains `18`? Jakub On Fri, 2026-03-13 at 14:14 +0000, revsuine wrote: > Hi, I'm trying to upgrade PostgreSQL from 17 to 18. The steps I did > were: >=20 > apk add postgresql18 > service postgresql stop > pg_versions set-default 18 > mv /var/lib/postgresql/17/data /var/lib/postgresql/17/olddata > mkdir -p /var/lib/postgresql/18/{data,tmp} > chown -R postgres:postgres /var/lib/postgresql/18 > su postgres > cd /var/lib/postgresql/18/tmp > initdb -D /var/lib/postgresql/18/data --locale=3Den_GB.UTF-8 --encoding= =3DUTF8 --data-checksums > pg_upgrade -b /usr/libexec/postgresql17 -B /usr/libexec/postgresql18 -d /= var/lib/postgresql/17/olddata -D /var/lib/postgresql/18/data >=20 > The output is >=20 > Performing Consistency Checks > ----------------------------- > Checking cluster versions > This utility can only upgrade to PostgreSQL version 18. > Failure, exiting >=20 > Any idea what I'm doing wrong? >=20 > Thanks in advance.