LoginSignup
1
1

postgresqlのtimezoneを変更する方法

Posted at

目標

PostgresqlのタイムゾーンをJSTに変更する備忘録です。

手順

  1. psqlで接続
  2. タイムゾーンの確認
  3. タイムゾーンの変更
  4. タイムゾーンの確認

接続

psql -h ホスト名 -p ポート番号 -U ロール名 -d データベース名

で接続できます。

タイムゾーンの確認

show timezone;

タイムゾーンの変更

SET timezone TO 'Asia/Tokyo';

再び、タイムゾーンの確認をして変更されていることを確認して作業終了です。

1
1
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
1
1