0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[PostgreSQL] 異なるversionのpsql, pg_dump コマンドを使用する

Posted at

Ubuntuで確認済み。元々ver11.xを使っていて、ver12.xを使用したいとする。
もっといい方法があるかも。

準備する

$ sudo apt update
$ sudo apt install postgresql-client-12

# Confirm that version of the commands are 12, not 11.
$ /usr/lib/postgresql/12/bin/pg_dump --version
pg_dump (PostgreSQL) 12.15 (Ubuntu 12.15-1.pgdg22.04+1)
$ /usr/lib/postgresql/12/bin/psql --version
psql (PostgreSQL) 12.15 (Ubuntu 12.15-1.pgdg22.04+1)

使用する

絶対パス指定で /usr/lib/postgresql/12/bin/psql コマンドを使い、やりたいことをする。

後片付けする

$ sudo apt remove postgresql-client-12

# Confirm that commands found in your command paths is version 11.
$ psql --version
psql (PostgreSQL) 11.19 (Ubuntu 11.19-1.pgdg22.04+1)
$ pg_dump --version
pg_dump (PostgreSQL) 11.19 (Ubuntu 11.19-1.pgdg22.04+1)
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?