LoginSignup
2
2

More than 5 years have passed since last update.

本番環境herokuのデータベースpostgreSQLの使い方...railsチュートリアル改造日記

Posted at

・課題
本番環境のテーブルに新たなカラムを追加したが、そこへの保存が上手くいかない。だから本番環境のテーブルを覗いてみる事に。

・経過
pgAdminというpostgreSQLに対する定番のGUIを使おうと思ったがcloud9には対応していないみたい。
ならばと、psqlコマンドを叩いて見る事にしよう。
postgreSQLの起動
sudo service postgresql start

postgresデータベースにユーザーpostgresdeで接続
psql -d postgres -U postgres

ここで返ってきた反応が
psql: FATAL: Peer authentication failed for user "postgres"

認証されない。ググって気付いた。herokuのpostgresに接続しようとしてる訳じゃない事に。

・解決
heroku pg:psql -c "\d"
で確かにデータベースを覗く事ができ

heroku pg:psql -c "select * from users;"
でusersテーブルを覗く事ができた。

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