Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed array literal #115

Closed
vanviegen opened this issue Sep 8, 2022 · 1 comment
Closed

Malformed array literal #115

vanviegen opened this issue Sep 8, 2022 · 1 comment

Comments

@vanviegen
Copy link

pg8000 encodes strings within arrays containing carriage return and newline characters without double quotes. For example ["a", "\r\n", "b"] gets encoded as '{"a",\r\n,"\b"}'. That'll throw a ProgrammingError with 'M': 'malformed array literal: "{"a",\r\n,"\b"}".

The right encoding is: '{"a","\r\n","\b"}'.

@tlocke
Copy link
Owner

tlocke commented Sep 29, 2022

Thanks for the bug report and patch @vanviegen, I've used the patch in 3d7b5bb with a few tweaks that I hope you agree with :-)

@tlocke tlocke closed this as completed Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants