Skip to content

Fix query encoding#19

Merged
nik-localstack merged 2 commits into
masterfrom
fix/query-encoding-regression
May 27, 2026
Merged

Fix query encoding#19
nik-localstack merged 2 commits into
masterfrom
fix/query-encoding-regression

Conversation

@nik-localstack
Copy link
Copy Markdown

@nik-localstack nik-localstack commented May 23, 2026

Motivation

While working on #18 this was observed as a bug.

Summary

  • decode and re-encode intercepted query text using the negotiated client_encoding
  • keep query interception working for non-UTF8 sessions instead of hardcoding UTF-8
  • add an end-to-end proxy test that exercises a LATIN1 client connection through the proxy

Testing

  • make start-pg-and-test

@nik-localstack nik-localstack self-assigned this May 23, 2026
Copy link
Copy Markdown
Collaborator

@bentsku bentsku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice and neat fix, quite the overlook 😅

@bentsku
Copy link
Copy Markdown
Collaborator

bentsku commented May 26, 2026

I just realized that there are several places in LocalStack where we patch the interceptor, and use to_str which will use utf-8 by default, so this might need to be updated too 😅

nik-localstack and others added 2 commits May 27, 2026 10:29
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nik-localstack nik-localstack force-pushed the fix/query-encoding-regression branch from 8ba2adf to 3d83aec Compare May 27, 2026 07:33
@nik-localstack nik-localstack merged commit 7a643cf into master May 27, 2026
2 checks passed
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.

2 participants