Heroku postgres postgis – django releases fail with: relation “spatial_ref_sys” does not exist

Here is the workaround that I’ve come up with for our review apps that use a database backup, through pg:backups:restore ( might want to enable meaintenance if you’re manipulating a production database): Copy your review app database locally (one that was recently restored through pg:backups:restore so you get all the data): heroku pg:pull [Database URL] … Read more

Pgadmin is not loading

Have a look at following link: https://www.postgresql-archive.org/pg-Admin-4-v4-28-Errors-on-launch-td6162407.html I think this is the fix you need Hi All We were not able to reproduce this issue on any of our machines during pre-release testing for v4.28. Then after some R&D, we are able to reproduce this issue. Cause of the problem: if value of “HKEY_CLASSES_ROOT.js\Content Type” … Read more

ERROR: extension “btree_gist” must be installed in schema “heroku_ext”

I have developed a monkey-patch solution that is, well, definitely a hack, but better than pre-dating migrations, or deleting lines from schema.rb. Put this in config/initializers. I called mine _enable_extension_hack.rb to make sure it gets loaded early. module EnableExtensionHerokuMonkeypatch # Earl was here def self.apply_patch! adapter_const = begin Kernel.const_get(‘ActiveRecord::ConnectionAdapters::PostgreSQLAdapter’) rescue NameError => ne puts “#{self.name} … Read more

How can I download db from heroku?

If you’re using Heroku’s pgbackups (which you probably should be using): $ heroku pg:backups capture $ curl -o latest.dump `heroku pg:backups public-url` “Translate” it into a postgres db with $ pg_restore –verbose –clean –no-acl –no-owner -h localhost -U myuser -d mydb latest.dump See https://devcenter.heroku.com/articles/heroku-postgres-import-export

Heroku Review Apps: copy DB to review app

I ran into this same issue and here is how I solved it. Set up the database url you want to copy from as an environment variable on the base app for the pipeline. In my case this is STAGING_DATABASE_URL. The url format is postgresql://username:password@host:port/db_name. In your app.json file make sure to copy that variable … Read more

Getting “Unknown primary key for table” while the ID is there

Seems primary key is missing for the table collections. Prior to Rails 3.2, set the primary key in model like class Collection < ActiveRecord::Base set_primary_key “my_existing_column” end In Rails 3.2+ and Rails 4, set the primary key in model like class Collection < ActiveRecord::Base self.primary_key = “my_existing_column” end OR We can alter the table and … Read more

Heroku Database Connection Properties

I also had the issue with the FATAL: no pg_hba.conf entry for host error message. I solved the connection issue to my Heroku Postgres database by adding the following to my JDBC string: &ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory. Example jdbc:postgresql://host:port/database?user=username&password=secret&ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory You will need the SSL option only if SSL is enabled for your Postgres database (which is the default). … Read more