3

When I make a database in Ruby, based on the Heroku instruction, I have to command like this:

heroku run rake db:migrate

So when I did this, my entries that are stored in my local pc weren't transferred to Heroku. So, after searching for the way how I can do this, I saw this method.

  1. Dumping the database file.
  2. Setting heroku
  3. heroku pg:push mylocaldb HEROKU_POSTGRESQL_MAGENTA --app sushi sushi = my app name in Heroku.

When I tried to do this, the below error occured: TOC entry error, owerner of extension plpqsql error.

...
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 2257; 0 0 COMMENT EXTENSION plpgsql 
pg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of extension plpgsql
    Command was: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';

..
WARNING: errors ignored on restore: 1

I make the database file by

pg_dump databasenamehere > databasedumpfile

And I found the "databasenamehere" in /config/database.yml,,, development name.

This keeps happening and I don't know what to do.. :(

How can I solve this issue?

Is there any good method to put the entries to the HEROKU?

Also, why rake:db:migrate didn't push the entries to heroku? ( thinking this is a rookie question )

Sungpah Lee
  • 1,003
  • 1
  • 13
  • 31
  • 5
    Take a look at [this Stackoverflow answer](http://stackoverflow.com/questions/10169203/postgresql-9-1-pg-restore-error-regarding-plpgsql/11776053#11776053) — it seems that your local database dump contains data that cannot be restored on Heroku. `pg:push` likely won't work for you. Try using Heroku pg:backups, and follow their [import procedure](https://devcenter.heroku.com/articles/heroku-postgres-import-export#import) with a custom dump. – janfoeh May 22 '15 at 07:20
  • But how can I know what cannot be uploaded? – Simon H Apr 27 '16 at 14:08
  • 1
    @janfoeh I get the same error using pg:backups. That does not seem to be a valid solution. – Steven Apr 29 '16 at 10:14
  • @Steven are both local and Heroku db schemas identical? Ie., could you create your local dump with `pg_dump --data-only`? – janfoeh Apr 29 '16 at 11:34
  • 1
    @janfoeh I don't know if I got your question. pg:backup creates a schema as far as I know. My target database on Heroku is empty and has never been used before. I have a more detailed explication here: http://stackoverflow.com/questions/36936213/heroku-restore-from-local-database-with-pgbackups-with-error-must-be-owner-of – Steven Apr 29 '16 at 11:42

0 Answers0