LoginSignup
0
0

More than 3 years have passed since last update.

「WARNING: psql version 9.2, server version 11.0. Some psql features might not work.」エラー対処(AWSLinux(EC2)からpsql11のインストール)

Last updated at Posted at 2020-07-28

EC2でpostgresqlを使えるようにするぞー!とやっている最中で「WARNING: psql version 9.2, server version 11.0. Some psql features might not work.」が出てきてふぁ!?ってなっていろいろ調べたので記録します。

Warningの内容

「サーバー側のバージョンは11.0だけどあなたが使っているpsqlバージョンは9.2よ!一部動かないかもしれないわ!」
と忠告してくれているようです。

対処

バージョン11のpostgresqlをインストールします。

sudo yum install postgresql

でpostgresqlをインストールしようとすると、なにやらいろいろでてきた後に

--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================
 Package                        Arch                  Version                           Repository                 Size
========================================================================================================================
Installing:
 postgresql                     x86_64                9.2.24-1.amzn2.0.1                amzn2-core                3.0 M
Installing for dependencies:
 postgresql-libs                x86_64                9.2.24-1.amzn2.0.1                amzn2-core                235 k

Transaction Summary
========================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 3.3 M
Installed size: 17 M
Is this ok [y/d/N]:

と出てきます。===の中を見ると、9.2のバージョンのpostgresqlをインストールしようとしているようです。

9.2はインストールしたくないので「N」と入力します。

すると

========================================================================================================================
 Package                        Arch                  Version                           Repository                 Size
========================================================================================================================
Installing:
 postgresql                     x86_64                9.2.24-1.amzn2.0.1                amzn2-core                3.0 M
Installing for dependencies:
 postgresql-libs                x86_64                9.2.24-1.amzn2.0.1                amzn2-core                235 k

Transaction Summary
========================================================================================================================
(略)
//ここでNを入力
Is this ok [y/d/N]: n

Exiting on user command
Your transaction was saved, rerun it with:
 yum load-transaction /tmp/yum_save_tx.2020-07-07.07-38.AfbT_W.yumtx


postgresql is available in Amazon Linux Extra topics "postgresql9.6" and "postgresql10" and "postgresql11"

To use, run
# sudo amazon-linux-extras install :topic:

Learn more at
https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras

postgresql is available in Amazon Linux Extra topics "postgresql9.6" and "postgresql10" and "postgresql11"

To use, run

sudo amazon-linux-extras install :topic:

と書いてあります。太字のコマンドを実行するといいよ!って親切に教えてくれました。ありがとう~(^^*)

トピックが三種類示されているので、そのうち「postgresql11」を指定します。

sudo amazon-linux-extras install postgresql11

インストールが終わったら、バージョンを確認してみます。

psql --version

「psql (PostgreSQL) 11.5」とでてきました!
無事インストールできました。

つまずいたポイント

以下のコマンドが実行できませんでした。

npn install postgresql11

VSCodeでローカル環境で開発していた時のコマンドはダメでした。(なにもわかっていない)

sudo yum install postgres11

yumできませんでした。他のインストールはできたのでなぜかこれだけできない状況で?でした。

yumのところをamazom-linux-extras にしたらできたのはどうしてですか?どなたかおしえてください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0