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

fail to create on databases that aren't UTF8 #281

Merged
merged 2 commits into from
Apr 10, 2023
Merged

Conversation

eeeebbbbrrrr
Copy link
Contributor

PL/Rust can't support databases that aren't UTF8 because of Rust's requirements around Strings being proper UTF8. This PR causes CREATE EXTENSION plrust to raise an ERROR in this case:

[v14.6][2495941] plrust=# create extension plrust;
ERROR:  PL/Rust only supports UTF8-encoded databases

This might be a little heavy-handed now but it gives us time to consider other options for relaxing this requirement.

The decision here stems from the fact that, currently, pgx blindly assumes all TEXT Datum conversions are valid UTF8, when they might not be. That's a problem too, but it's still not clear the RightWay to resolve that and likely wouldn't do us any good here in plrust anyways.

Copy link
Contributor

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

Reviewed the out-of-band discussion and I think this is good.

@eeeebbbbrrrr eeeebbbbrrrr changed the base branch from main to develop April 10, 2023 14:09
@eeeebbbbrrrr eeeebbbbrrrr merged commit 70db427 into develop Apr 10, 2023
@eeeebbbbrrrr eeeebbbbrrrr mentioned this pull request Apr 25, 2023
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