Issue
You are seeing ERROR: must be owner of extension plpgsql
or similar when you attempt to run rake db:structure:load
.
Resolution
When Rails generates structure.sql
, it includes commands to enable the database extensions it wants to use. Unfortunately, these are blocked by heroku-postgresql
. One way around this is to use config.active_record.schema_format = :ruby
, which means your app would generate a schema.rb
instead of a structure.sql
. schema.rb
is compatible with heroku-postgresql
because it doesn't enable extensions.
If you need to use structure.sql
you can remove COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
which should also resolve this issue.