public inbox for [email protected]  
help / color / mirror / Atom feed
From: Laurenz Albe <[email protected]>
To: Ianseeks <[email protected]>
To: [email protected]
Subject: Re: fail to run postgresql16 after update from postgresql13
Date: Thu, 02 Nov 2023 15:27:34 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <5997577.lOV4Wx5bFT@lian-li>
References: <4842483.GXAFRqVoOG@lian-li>
	<[email protected]>
	<5997577.lOV4Wx5bFT@lian-li>

On Thu, 2023-11-02 at 11:13 +0000, Ianseeks wrote:
> On Thursday, 2 November 2023 10:16:33 GMT Laurenz Albe wrote:
> 
> > > I can't get Akonadi to load as it fails to start postgresql16, its failing
> > > with a message saying it needs postgesql9.6 as the DB was originally
> > > created using 9.6. I can't see why it insists on ver 9.6 being there as
> > > i've updated to ver 16 and that process means i create an empty DB.  I
> > > can't even install Ver 9.6 to see if that cures the problem as its no
> > > longer in the opensuse repos.
> > > 
> > > This is from "systemctl status postgresql.service"
> > > 
> > > Oct 31 16:24:13 Lian-Li systemd[1]: Starting PostgreSQL database server...
> > > Oct 31 16:24:13 Lian-Li postgresql-script[5916]:  Your database files were created by PostgreSQL version 9.6.
> > 
> > These error messages are not from PostgreSQL, but they seem to be from
> > the script "postgresql-script".  That script is not part of PostgreSQL.
> > 
> > Look into that script and try to figure out how it arrives at that
> > conclusion. If you cannot figure it out yourself, please share the relevant
> > parts.
> 
> Is it acceptable to attach text files to email in this mailing list?  I know 
> some don't like it.
> I've found the script file (/usr/share/postgresql/postgresql-script) and that 
> message is in there but the coding in it is beyond my expertise as i can only 
> do basic stuff.
> Here is a cut and paste of part of it.
> 
> ----- /usr/share/postgresql/postgresql-script ----
> 
> PG_SYSCONFIG=/etc/sysconfig/postgresql
> test -f $PG_SYSCONFIG && . $PG_SYSCONFIG

Look into "/etc/sysconfig/postgresql" and see if it sets POSTGRES_DATADIR.

> eval DATADIR=${POSTGRES_DATADIR:-~postgres/data}

If not, DATADIR is set to the subdirectory "data" of the home directory
of user "postgres".

Is DATADIR the data directory you upgraded?

> OPTIONS=${POSTGRES_OPTIONS}
> INITDB_OPTS=${POSTGRES_INITDB_OPTS}
> PIDFILE=$DATADIR/postmaster.pid
> 
> # 
> if test -r $DATADIR/PG_VERSION ; then
>     DATA_VERSION=$(cat $DATADIR/PG_VERSION)
>     POSTGRES=/usr/lib/postgresql$(echo -n $DATA_VERSION | tr -d .)/bin/postgres
> fi

DATA_VERSION is set to the first line in the PG_VERSION file in DATADIR.

What is that?  According to the error message, it should be 9.6.

POSTGRES is set to /usr/lib/postgresql<DATA_VERSION with periods removed>/bin/postgres

> if test -x /usr/bin/postgres; then
>     ACTIVE=$(readlink -q -f /usr/bin/postgres)
>     test -z "$POSTGRES" && POSTGRES="$ACTIVE"
> fi
> if test -n "$DATA_VERSION"; then
>     if test -z "$ACTIVE" -o "$ACTIVE" != "$POSTGRES"; then
> 	echo " Your database files were created by PostgreSQL version $DATA_VERSION."

Looks like /usr/bin/postgres, if you resolve the symbolic link, is different
from POSTGRES constructed above.

Yours,
Laurenz Albe





view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: fail to run postgresql16 after update from postgresql13
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox