Skip to content

Instantly share code, notes, and snippets.

@ucan-lab
Last active July 15, 2018 00:55
Show Gist options
  • Select an option

  • Save ucan-lab/cab1ab10f40ac095be8b95c2e356fa8f to your computer and use it in GitHub Desktop.

Select an option

Save ucan-lab/cab1ab10f40ac095be8b95c2e356fa8f to your computer and use it in GitHub Desktop.
HerokuのPostgreSQLにログインしてSQLを直接実行する。 ref: https://qiita.com/ucan-lab/items/fb74af3d78e71407db7b
$ heroku pg:psql
--> Connecting to postgresql-nipple-114514
▸ The local psql command could not be located. For help installing psql, see
▸ https://devcenter.heroku.com/articles/heroku-postgresql#local-setup
$ heroku pg:info
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 0/20
PG Version: 10.4
Created: 2018-07-12 10:55 UTC
Data Size: 8.2 MB
Tables: 6
Rows: 5/10000 (In compliance)
Fork/Follow: Unsupported
Rollback: Unsupported
Continuous Protection: Off
Add-on: postgresql-nipple-114514
$ sudo yum -y install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
$ sudo yum -y install postgresql10
$ psql -V
psql (PostgreSQL) 10.4
$ heroku pg:psql
--> Connecting to postgresql-nipple-114514
psql (10.4)
SSL 接続 (プロトコル: TLSv1.2、暗号化方式: ECDHE-RSA-AES256-GCM-SHA384、ビット長: 256、圧縮: オフ)
"help" でヘルプを表示します。
app-name::DATABASE=>
> SELECT * FROM hogehoge;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment