DEBUG=* heroku pg:psql -a my-heroku-app -c "COPY (SELECT * FROM small_table) TO STDOUT;" > ~/Downloads/table.dump
...
pg Using "DATABASE_URL" to connect to your database… +745ms
--> Connecting to postgresql-whatever-12345
pg Running query: COPY (SELECT * FROM small_table) TO STDOUT; +2ms
# Completes successfully and data is in ~/Downloads/table.dump
But when there's more data:
DEBUG=* heroku pg:psql -a my-heroku-app -c "COPY (SELECT * FROM very_large_table) TO STDOUT;" > ~/Downloads/table.dump
...
pg Using "DATABASE_URL" to connect to your database… +701ms
--> Connecting to postgresql-whatever-12345
pg Running query: COPY (SELECT * FROM very_large_table) TO STDOUT; +2ms
/Users/jacobevelyn/.local/share/heroku/client/7.35.1/node_modules/@heroku-cli/plugin-pg-v5/lib/psql.js:24
result += data.toString()
^
RangeError: Invalid string length
at Socket.<anonymous> (/Users/jacobevelyn/.local/share/heroku/client/7.35.1/node_modules/@heroku-cli/plugin-pg-v5/lib/psql.js:24:22)
at Socket.emit (events.js:210:5)
at addChunk (_stream_readable.js:308:12)
at readableAddChunk (_stream_readable.js:289:11)
at Socket.Readable.push (_stream_readable.js:223:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:182:23)
What is the expected behavior?
The second example above should complete successfully, like the first.
This is happening on Heroku CLI version heroku/7.35.1 darwin-x64 node-v12.13.0 on macOS 10.15.2. I'm not behind an HTTP proxy or firewall.
What is the current behavior?
With a small table:
But when there's more data:
What is the expected behavior?
The second example above should complete successfully, like the first.
This is happening on Heroku CLI version
heroku/7.35.1 darwin-x64 node-v12.13.0
on macOS 10.15.2. I'm not behind an HTTP proxy or firewall.