heroku-postgres

How to backup/restore standalone heroku postgres database?

大城市里の小女人 提交于 2019-12-04 13:00:52
Is there a Heroku way to backup / restore a standalone postgres database at https://postgres.heroku.com/ apart from using pg_dump / pg_restore ? The database is not attached to any app. I can create a dump using pg_dump --verbose -F c -b -h hostname -p port -U username -f "backup.dump" database_name and restore it using pg_restore --verbose --clean --no-acl --no-owner -h hostname -p port -U username -d database_name "backup.dump" Looks when you create a new database, heroku automatically creates an app for you. Check it with heroku list So you can restore using the empty app. heroku pgbackups

gem install dm-postgres-adapter build error

笑着哭i 提交于 2019-12-04 11:27:24
问题 i'm trying to build dm-postgres-adapter but get this error. sudo gem install dm-postgres-adapter Building native extensions. This could take a while... ERROR: Error installing dm-postgres-adapter: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb checking for main() in -lpq... yes checking for libpq-fe.h... yes checking for libpq/libpq-fs.h... yes checking for postgres.h... yes checking for mb/pg_wchar.h... no ***

Error transferring database from MySql to Postgres using mysql2pgsql

烈酒焚心 提交于 2019-12-04 08:39:54
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 Exception('unknown %s' % column['type']) Exception: unknown datetime(6) ". This seems strange, because

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

余生颓废 提交于 2019-12-04 03:55:21
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 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 superusers (from original doc) . Heroku doesn't give you superuser privileges. So you need to disable extension pg

Can't deploy to Heroku because the server refused the connection

被刻印的时光 ゝ 提交于 2019-12-04 03:26:27
I wanted to deploy my local Rails app (that works perfectly) to Heroku, but get the following error message: rake aborted! could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432? /tmp/build_21pkcz898c28o/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize' Followed by many lines about postgres_adapter . I'm a bit disappointed because I red that Heroku overwrite config/database.yml so why does it talk about running the server on 127.0.0.1

How to use php artisan migrate command of Laravel4 in Heroku?

[亡魂溺海] 提交于 2019-12-04 00:35:01
I am suing Heroku dev plan for creating database using PostgreSQL . Database is created in Heroku. After running heroku pg:info command $ heroku pg:info === HEROKU_POSTGRESQL_XXX_URL Plan: Hobby-dev Status: available Connections: 1 PG Version: 9.3.1 Created: 2013-11-27 04:00 UTC Data Size: 6.4 MB Tables: 0 Rows: 0/10000 (In compliance) Fork/Follow: Unsupported Rollback: Unsupported Result shows zero tables, which is correct. In my local machine tables are created by using following command which are supported in Laravel4 framework. php artisan migrate php artisan db:seed But it seems like I

How to change DATABASE_URL for a heroku application

╄→гoц情女王★ 提交于 2019-12-03 18:00:11
问题 I wanted to use an external Database with my heroku application. But I'm unable to edit the configuration cariables. I tried using GUI, Which says, Cannot overwrite attachment values DATABASE_URL. While I tried using CLI as well. I used the command: heroku config:addDATABASE_URL="postgresql://username:password@IP:PORT" . However, this throws an error ... is not a heroku command. 回答1: After trying out most these answers, I came across an update in 2016, here: the database needs to be detached

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

不打扰是莪最后的温柔 提交于 2019-12-03 13:56:25
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 name d3kwlkwlwjwljetc... . Searching for this message gives me people who are trying to drop or reset

How to create or manage heroku_postgres database instance

蓝咒 提交于 2019-12-03 06:05:00
问题 I am developing a simple PHP application running on Heroku. I have created a CSV file and am using it as a simple database. Now I want to create a database on Heroku, so I added a Postgres instance and its name is heroku-postgres-9f90a33a::ivory . I want to know how I can create and manage my database instance to perform actions like creating a table. 回答1: First you login to your heroku account Then you go to databases section 3 There you create a database by clicking on Create Database Then

ConnectionTimeoutError on Heroku with Postgres

无人久伴 提交于 2019-11-30 15:37:33
问题 I’m having problems with my application deployed on Heroku. It works fine on local env, but when deployed to Heroku there are often application errors. The exception in logs are: ActiveRecord::ConnectionTimeoutError (could not obtain a database connection within 5.000 seconds (waited 5.000 seconds)) The controller and models are nothing fancy, rather simple CRUD operations. The app is build with Rails 4, its using standard heroku postgres database add-on and WEBrick server. I've tried to set