heroku-postgres

Knex Migration Postgres Heroku - Error: Unable to Acquire Connection

时间秒杀一切 提交于 2019-12-10 10:18:16
问题 I am trying to run my first migration which creates a single table in a heroku postgres database. When I try to run knex migrate:latest --env development I receive the error Error: Unable to acquire a connection . Things I've tried: adding ?ssl=true to the end of my connection string stored in process.env.LISTINGS_DB_URL as I'm aware this is sometimes a requirement to connect with heroku setting the env variable PGSSLMODE=require I also stumbled across this article where someone has commented

Error transferring database from MySql to Postgres using mysql2pgsql

别等时光非礼了梦想. 提交于 2019-12-09 18:24:21
问题 In order to host my Python/Django app on Heroku, I'm trying to convert my db from MySQL to Postgres following the instructions on https://realpython.com/blog/python/migrating-your-django-project-to-heroku/. I'm currently running OSX 10.9, and am using the tool mysql2pgsql to make the transfer. When I try to run the command " py-mysql2pgsql -v -f mysql2pgsql.yml " to actually transfer the db, it copies over the first three tables, and then hits a snag on auth_user, returning the error " raise

Heroku + Apartment PG::Error: ERROR: function pg_stat_statements_reset() does not exist

主宰稳场 提交于 2019-12-09 16:32:45
问题 I use Apartment gem in Rails 4 to support multi-tenancy in Postgres 9.3.3 on Heroku. An error is occurred when Apartment gem creates a new tenant. Deep investigation showed that a schema was created, but no tables inside. Heroku logs showed an error: PG::Error: ERROR: function pg_stat_statements_reset() does not exist 回答1: When a new schema is created Postgres is trying to reset stats by executing the function pg_stat_statements_reset() By default, this function can only be executed by

heroku pg: pull not fetching tables from heroku database

拟墨画扇 提交于 2019-12-08 04:24:28
问题 I'm trying to pull a heroku database to my local Windows computer by using heroku bash command heroku pg:pull HEROKU_POSTGRESQL_COLOR mydatabase --app appname , when I running above command I get the following error: 'env' is not recognized as an internal or external command, operable program or batch file.! But local database 'mydatabase' is created, but without any tables. My heroku app's database has a table in it, but it is not getting pulled to my local database. Help me to solve it. 回答1

heroku rake db:structure:load failure

僤鯓⒐⒋嵵緔 提交于 2019-12-06 20:20:59
问题 I need to use some PostgreSQL proprietary features such as rules and triggers for table partitioning. As long as I know, these kind of features cannot be dump to schema.rb so I have changed my schema_format configuration parameter to :sql. Now, when I try to load rake db:structure:load to load the generated structure.sql into the heroku database, it fails saying: sh: psql: not found How can I do it? 回答1: You can use pg:psql to run the script from your development machine against the database:

Knex Migration Postgres Heroku - Error: Unable to Acquire Connection

回眸只為那壹抹淺笑 提交于 2019-12-05 19:59:59
I am trying to run my first migration which creates a single table in a heroku postgres database. When I try to run knex migrate:latest --env development I receive the error Error: Unable to acquire a connection . Things I've tried: adding ?ssl=true to the end of my connection string stored in process.env.LISTINGS_DB_URL as I'm aware this is sometimes a requirement to connect with heroku setting the env variable PGSSLMODE=require I also stumbled across this article where someone has commented that knex will not accept keys based on environment. However, I'm attempting to follow along with this

How can I set logging level for Heroku Postgresql?

强颜欢笑 提交于 2019-12-05 15:22:57
Using Heroku with the Postgresql add-on. Upon reviewing my logs, it seems postgresql is logging every ... single ... transaction. I understand you can set the log level by doing something like ( https://www.postgresql.org/docs/9.1/static/runtime-config-logging.html ) ALTER DATABASE my_database SET log_statement=error; However, Heroku says ERROR: permission denied to set parameter "log_statement" Note that might be a possible duplicate of how to turn off Heroku SQL logs from postgres but they never addressed how to get around the Heroku permissions. (Should I start a bounty on that ticket or

heroku rake db:structure:load failure

时间秒杀一切 提交于 2019-12-05 01:52:26
I need to use some PostgreSQL proprietary features such as rules and triggers for table partitioning. As long as I know, these kind of features cannot be dump to schema.rb so I have changed my schema_format configuration parameter to :sql. Now, when I try to load rake db:structure:load to load the generated structure.sql into the heroku database, it fails saying: sh: psql: not found How can I do it? You can use pg:psql to run the script from your development machine against the database: cd your-rails-project heroku pg:psql -a your-app-name <db/structure.sql Just make sure that the branch you

Heroku Schema load: Permission denied for database “postgres” User

浪尽此生 提交于 2019-12-04 21:44:04
问题 I'm trying to deploy my Rails app to Heroku, and I now want to load my schema. I get the following error: Running `bundle exec rake db:schema:load` attached to terminal... up, run.1533 rake aborted! PG::ConnectionBad: FATAL: permission denied for database "postgres" DETAIL: User does not have CONNECT privilege. Which is weird because postgres is not the database it should connect to. The database URL, which is available to the app via ENV, has the right values, and the long apparently random

Can't Push Rails Project to Heroku

余生长醉 提交于 2019-12-04 16:56:26
So I've run into a little snag with a rails app that i'm trying to deploy on to Heroku. When I attempt to push my app onto Heroku, I'm told that rake tasks cannot be detected. In addition, I'm told that the application file in the config folder cannot be loaded. I ran this little command (bundle exec rake -P RAILS_ENV=production) to see if everything in production mode checks out and I don't get any errors. I really appreciate anyones help as this is my first time deploying an app on Heroku. Thanks! Total 7266 (delta 1071), reused 0 (delta 0) remote: Compressing source files... done. List item