pgdump-aws-lambda icon indicating copy to clipboard operation
pgdump-aws-lambda copied to clipboard

Error: pg_dump gave us an unexpected response

Open Bonemind opened this issue 5 years ago • 1 comments

I ran into your lambda today an managed to deploy it. Everything seems to work fine under normal circumstances, but I encounter an error when i try to change the output format (I tried -Fp and --format=plain). When using the PGDUMP_ARGS to change the output format, I get the following exception:

"Error: pg_dump gave us an unexpected response". I've looked through the code and this seems to be intended behavior, since the lambda defaults to -Fc and -Z 1 as params, so you can check for PGDMP as a start token and throw on everything else. If I understand the code correctly, it might be possible to check for pg_dump: as token and flag the output as an error instead since pg_dump output seems to communicate to the user with that as a prefix, and otherwise assume pg_dump's output is useful. pg_dump also seems to set a sane exit code which might be useful.

Bonemind avatar Jan 22 '20 16:01 Bonemind

Yep that’s 100% correct!

It currently only supports binary backups.

Your plan sounds sane. If you would like to open a PR, i would be happy to review and merge. Otherwise i can add support when i get time to work on it again (might be some time).

jameshy avatar Jan 22 '20 16:01 jameshy