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

Postgresql fails due to use of utf8mb4 default encoding #153

Closed
Ramblurr opened this issue Mar 25, 2024 · 7 comments
Closed

Postgresql fails due to use of utf8mb4 default encoding #153

Ramblurr opened this issue Mar 25, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@Ramblurr
Copy link
Contributor

When specifying a postgresql connection uri like postgres://username:password@host/dbname

The migrations fail with the (server side error):

postgres[1748124]: [1748124] ERROR:  invalid value for parameter "client_encoding": "utf8mb4"

Changing the uri to postgres://username:password@host/dbname?charset=UTF-8 is a workaround to this problem, but since utf8mb4 isn't a valid encoding type for postgres, it shouldn't be necessary.

@tchapi
Copy link
Owner

tchapi commented Mar 25, 2024

Hi @Ramblurr

Good catch! The default only works for mySQL but I think that the encoding should be passed in the connection string every time, so we might want to remove it altogether so the error message is clearer

I'll do that soon

@Ramblurr
Copy link
Contributor Author

It's interesting because the charset query parameter isn't a valid Postgres URI param. This seems to align with some troubles I had using a valid Postgres URI that doctrine complained about.

I suppose under the hood doctrine is parsing the URI and rebuilding it?

@tchapi
Copy link
Owner

tchapi commented Mar 25, 2024

Done in 7b50e1b — can you confirm it fixes your error?

@tchapi tchapi added the bug Something isn't working label Mar 25, 2024
@tchapi tchapi self-assigned this Mar 25, 2024
@Ramblurr
Copy link
Contributor Author

Thanks for the quick turnaround, I'll test this today.

@tchapi
Copy link
Owner

tchapi commented Mar 29, 2024

Is it all good on your side @Ramblurr? I'll probably release in the weekend

Thanks!

@tchapi
Copy link
Owner

tchapi commented Apr 1, 2024

Gentle ping @Ramblurr on this one 🙏🏼 thanks

@Ramblurr
Copy link
Contributor Author

Ramblurr commented Apr 2, 2024

Can confirm postgresql is working without manually setting ?charset=UTF-8 in the url now. Thanks!

@Ramblurr Ramblurr closed this as completed Apr 2, 2024
Ramblurr added a commit to Ramblurr/nixpkgs that referenced this issue Apr 3, 2024
* Our patchset is no longer required (see tchapi/davis#156)
* Though the upstream var names changed, so we had to update those too
* These vars are managed by the nixos module and hence are not breaking
  changes for users of the module.
* Also removed need to specify postgres charset in non-standard way
  (see tchapi/davis#153)

Release notes: https://github.com/tchapi/davis/releases/tag/v4.4.2
Ramblurr added a commit to Ramblurr/nixpkgs that referenced this issue Apr 3, 2024
* Our patchset is no longer required (see tchapi/davis#156)
* Though the upstream var names changed, so we had to update those too
* These vars are managed by the nixos module and hence are not breaking
  changes for users of the module.
* Also removed need to specify postgres charset in non-standard way
  (see tchapi/davis#153)

Release notes: https://github.com/tchapi/davis/releases/tag/v4.4.2
github-actions bot pushed a commit to Mic92/nixpkgs that referenced this issue Apr 7, 2024
* Our patchset is no longer required (see tchapi/davis#156)
* Though the upstream var names changed, so we had to update those too
* These vars are managed by the nixos module and hence are not breaking
  changes for users of the module.
* Also removed need to specify postgres charset in non-standard way
  (see tchapi/davis#153)

Release notes: https://github.com/tchapi/davis/releases/tag/v4.4.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants