データベースファイルはPostgreSQLバージョン13で作成されました

データベースファイルはPostgreSQLバージョン13で作成されました

OS は openSUSE Tumbleweed です。以前は PostgreSQL 13 がインストールされていましたが、次の方法で削除しました。

> sudo zypper rm 'postgres*'

> sudo zypper rr PostgreSQL

> sudo rm -rf /usr/local/var/postgres

次に指示に従ってPostgreSQL 12をインストールしますここ:

> sudo zypper addrepo http://download.opensuse.org/repositories/server:database:postgresql/openSUSE_Tumbleweed/ PostgreSQL

> sudo zypper ref

> sudo zypper in -f postgresql postgresql-server postgresql-contrib

> sudo zypper in -f postgresql-plperl postgresql-plpython postgresql-pltlc

> sudo systemctl enable postgresql

> sudo systemctl start postgresql

しかし、データベースのステータスに問題があります:

> sudo systemctl status postgresql.service  
[sudo] password for root:  
● postgresql.service - PostgreSQL database server
     Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Thu 2021-05-27 23:08:43 EDT; 2h 10min ago
    Process: 1576 ExecStart=/usr/share/postgresql/postgresql-script start (code=exited, status=1/FAILURE)
        CPU: 21ms

May 27 23:08:43 localhost systemd[1]: Starting PostgreSQL database server...
May 27 23:08:43 localhost postgresql-script[1576]:  Your database files were created by PostgreSQL version 13.
May 27 23:08:43 localhost postgresql-script[1576]:  Could not find executables for this version.
May 27 23:08:43 localhost postgresql-script[1576]:  Please install the PostgreSQL server package for version 13.
May 27 23:08:43 localhost systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE
May 27 23:08:43 localhost systemd[1]: postgresql.service: Failed with result 'exit-code'.
May 27 23:08:43 localhost systemd[1]: Failed to start PostgreSQL database server.

何らかの理由で、何を試しても、これらのステータス エラーを解消できません。

データベース ファイルは PostgreSQL バージョン 13 によって作成されました。

このバージョンの実行可能ファイルが見つかりませんでした。

バージョン 13 の PostgreSQL サーバー パッケージをインストールしてください。

PostgreSQL 12 をインストールして、PostgreSQL 13 データベース ファイルを削除するにはどうすればよいですか?

答え1

@cas のコメントで示唆されているように:

13 から 12 にダウングレードするという考えを断念することにしました。Pg 13 を再インストールし、そのまま使い続けています。

私は 12 ページを推奨するプラットフォームで働いています。ただし、13 で何か問題が発生しない限り、12 に戻ることはありません。

関連情報