This is a very urgent situation.
We have a postgres 9.4 database installed on a CentOs machine.
We are trying to take a backup from a Heroku Postgres database and restore it to the database on CentOs machine.
The commands we are using:
pg_dump -Fc -h ec2-99-99-99-99.compute-1.amazonaws.com -p 5762 -U xyz -d dbname > file.dump
The dump created by pg_dump seems to be missing data from columns that have the type of binary (these columns contain images in binary format).
When we restore this backup to the database on CentOS using following command, all the images from the image i.e. binary type columns are missing:
pg_restore -d onlinedb ~/file.dump
We have to go live in the morning and are completely bummed by this unexpected issue.
Output of \d attachments
(attachments is the problem table) command:
Table "public.attachments"
Column | Type | Modifiers
------------------+------------------------+-----------
id | integer | not null
configuration_id | integer |
style | character varying(255) |
file_contents | bytea |
More information: The heroku postgres database from which we are creating backup is PostgreSQL 9.2.6. The one we are restoring to is PostgreSQL 9.4.
bytea
? Show the schema - output frompsql
's\d
command on one of the problem tables. Then show the output ofpg_restore -t the_table_name --schema-only
.\d tablename
on one of the tables with binary data that's causing you problems.pg_restore -t the_table_name
(I think that syntax is right). Also, which pg_dump and pg_restore versions are you using?