Last active
July 15, 2018 00:55
-
-
Save ucan-lab/cab1ab10f40ac095be8b95c2e356fa8f to your computer and use it in GitHub Desktop.
HerokuのPostgreSQLにログインしてSQLを直接実行する。 ref: https://qiita.com/ucan-lab/items/fb74af3d78e71407db7b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ heroku pg:psql | |
| --> Connecting to postgresql-nipple-114514 | |
| psql (10.4) | |
| SSL 接続 (プロトコル: TLSv1.2、暗号化方式: ECDHE-RSA-AES256-GCM-SHA384、ビット長: 256、圧縮: オフ) | |
| "help" でヘルプを表示します。 | |
| app-name::DATABASE=> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > \d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > SELECT * FROM hogehoge; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment