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

Fix parameters for JSONB field #10455

Merged
merged 1 commit into from
Jan 31, 2025
Merged

Conversation

flvndvd
Copy link
Contributor

@flvndvd flvndvd commented Jan 31, 2025

Description

While running a relocation in production, we notice some serialization errors:

detail":"Expected \":\", but found \",\".","where":"JSON data, line 1: ..

Indeed, using binds to pass parameters does not work well with array of plain objects. This PR fixes it:

  • by ensuring that all paramters are properly sanitized before being saved in GCS
  • to temporarily unblock the current workflow, also sanitize in the region if not already done (this will be removed afterward).

Also tested for array of primitives types and regular plain object, those two types don't need any stringify.

Tests

Tested locally, was able to reproduce issue and this fix actually solve the issue.

Risk

Deploy Plan

@flvndvd flvndvd marked this pull request as ready for review January 31, 2025 23:53
@flvndvd flvndvd merged commit d5d0637 into main Jan 31, 2025
6 checks passed
@flvndvd flvndvd deleted the flav/fix-jsonb-insert-statement branch January 31, 2025 23:57
@flvndvd
Copy link
Contributor Author

flvndvd commented Jan 31, 2025

PMRR

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 this pull request may close these issues.

1 participant