tchapi / davis

🗓 A simple, fully translatable admin interface for sabre/dav based on Symfony 5 and Bootstrap 5, initially inspired by Baïkal.

Home Page:https://github.com/users/tchapi/projects/1/views/1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Postgresql fails due to use of `utf8mb4` default encoding

Ramblurr opened this issue · comments

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.

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

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?

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

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

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

Thanks!

Gentle ping @Ramblurr on this one 🙏🏼 thanks

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