-
Notifications
You must be signed in to change notification settings - Fork 11
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
json_extract_array_element_text for strings #3
Comments
Similar issue in
|
In addition to a strip on the returning values, a check that the index is valid is needed.
|
shawnpyle
added a commit
to shawnpyle/docker-pgredshift
that referenced
this issue
Jan 18, 2022
Redshift returns NULL when a value cannot be found. Redshift strips quotes from strings returned in the JSON. Redshift checks for valid index when using json_extract_array_element_text.
shawnpyle
added a commit
to shawnpyle/docker-pgredshift
that referenced
this issue
Jan 18, 2022
Redshift returns NULL when a value cannot be found. Redshift strips quotes from strings returned in the JSON. Redshift checks for valid index when using json_extract_array_element_text.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compare:
select json_extract_array_element_text('["Sandwich", "Omelette", "Tikka Masala"]', 0)
In Redshift, that gets you an unquoted
Sandwich
, in docker-pgredshift that gets you a double-quoted"Sandwich"
.Adding
.strip('"')
to thejson.dumps
seems to solve it:The text was updated successfully, but these errors were encountered: