heroku - Unable to connect to production db for taking custom pg_dump -


i trying pg_dump on production db using heroku pg:credentials. when try take dump, takes long time , gives me error:

ssl syscall error: operation timed out

however, connecting db using same credentials using psql command works fine.

i tried

pg_dump -s -h abcded.compute.amazonaws.com -d adflaksjdfl23 -u username -p 5512 password: 

result:

pg_dump: [archiver (db)] query failed: ssl syscall error: operation timed out pg_dump: [archiver (db)] query was: select c.tableoid, c.oid, c.relname, c.relacl, c.relkind, c.relnamespace, (select rolname pg_catalog.pg_roles oid = c.relowner) rolname, c.relchecks, c.relhastriggers, c.relhasindex, c.relhasrules, c.relhasoids, c.relfrozenxid, c.relminmxid, tc.oid toid, tc.relfrozenxid tfrozenxid, tc.relminmxid tminmxid, c.relpersistence, c.relispopulated, 'd' relreplident, c.relpages, case when c.reloftype <> 0 c.reloftype::pg_catalog.regtype else null end reloftype, d.refobjid owning_tab, d.refobjsubid owning_col, (select spcname pg_tablespace t t.oid = c.reltablespace) reltablespace, array_to_string(array_remove(array_remove(c.reloptions,'check_option=local'),'check_option=cascaded'), ', ') reloptions, case when 'check_option=local' = (c.reloptions) 'local'::text when 'check_option=cascaded' = (c.reloptions) 'cascaded'::text else null end checkoption, array_to_string(array(select 'toast.' || x unnest(tc.reloptions) x), ', ') toast_reloptions pg_class c left join pg_depend d on (c.relkind = 's' , d.classid = c.tableoid , d.objid = c.oid , d.objsubid = 0 , d.refclassid = c.tableoid , d.deptype = 'a') left join pg_class tc on (c.reltoastrelid = tc.oid) c.relkind in ('r', 's', 'v', 'c', 'm', 'f') order c.oid 

i not sure why it's failing you, if works can use heroku toolbelt capture dump , download it.

this can done in 2 simple steps:

heroku pg:backups capture --app app-name curl -o latest.dump `heroku pg:backups public-url --app-name` 

https://devcenter.heroku.com/articles/heroku-postgres-import-export#export


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -