pg_dump hangs

After creating my Postgres database back in March, I was able to successfully back it up periodically by opening a flyctl proxy and executing pg_dump. However, a week ago, the dump started hanging right after “reading user-defined tables”:

❯ pg_dump -U postgres -h localhost -d wordmaster -v
pg_dump: last built-in OID is 16383
pg_dump: reading extensions
pg_dump: identifying extension members
pg_dump: reading schemas
pg_dump: reading user-defined tables

I can connect just fine with psql -h localhost -d wordmaster and read the entire table:

❯ psql -U postgres -h localhost -d wordmaster
psql (14.2, server 14.1 (Debian 14.1-1.pgdg110+1))
Type "help" for help.
wordmaster=# select count(*) from words;
 count 
-------
  4891
(1 row)

Any idea why pg_dump hangs? I tried restarting the postgres instance to no avail.

Yes, the same things.

I discovered that this only happens behind VPN. If I turn off my VPN, it succeeds.

I seem to be running into this right now, not behind a VPN. @Maksim, did this issue ever resolve itself for you?

I’ve just found a workaround: ssh to db host, pg_dump and do sftp.

1 Like

How did you sftp?

Edit: figured it out:

flyctl ssh sftp get db.pgdump -a app-db
1 Like