launchctl unload ~/Library/LaunchAgents/org.postgresql.postgres.plist
launchctl load ~/Library/LaunchAgents/org.postgresql.postgres.plist
mysql: SHOW TABLES
postgresql: \d
postgresql: SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';
mysql: SHOW DATABASES
postgresql: \l
postgresql: SELECT datname FROM pg_database;
mysql: SHOW COLUMNS
postgresql: \d table
postgresql: SELECT column_name FROM information_schema.columns WHERE table_name ='table';
mysql: DESCRIBE TABLE
postgresql: \d+ table
postgresql: SELECT column_name FROM information_schema.columns WHERE table_name ='table';
I attempted to push an existing Rails 4.1.4 application to an Ubuntu 14.04 Cloud server on SoftLayer this week. Here were all of the things that went wrong.
Database encoding: once everything was setup, Postgres was complaining that my database encoding (UTF-8) was not gelling with the SQL_ASCII
encoding. Make sure you have console access before moving on:
Postgre console access: I was unable to access the console out of the box using dokku postgresql:console <APP_NAME>
. A brief warning was returned suggesting that the postgresql-client
wasn't installed as it could not find the psql
executable. This one actually has nothing to do with Dokku or Docker: sudo apt-get install postgres-client
.
Rebuild Template1
: It turns out the encoding error came from Postgres attempting to build a new table from one of the default templates that provided the incorrect encoding. This answer came by way of Stack Overflow.
Postgres role: I had attempted to inherit the local role and run the production database under the app name as suggested on Digital Ocean. Unfortunately, Dokku runs as the root user. Simply update your production username
value to root
.