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

Amavis + psql for en_US #488

Open
JReming85 opened this issue Mar 9, 2023 · 2 comments
Open

Amavis + psql for en_US #488

JReming85 opened this issue Mar 9, 2023 · 2 comments
Labels
bug postgres PostgreSQL

Comments

@JReming85
Copy link

JReming85 commented Mar 9, 2023

Impacted versions

  • Distribution: Debian / Ubuntu / Centos
  • Codename: Jessie / Trusty / Centos 7 / ...
  • Arch: 32 Bits / 64 Bits
  • Database: PostgreSQL

Steps to reproduce

Install on a system with en_US set as locale

When amavis trys to write msgs to psql its default encoding will be set to latin1 and cause errors trying to convert utf8 to latin1 for some emails.

from Mail.err
amavis[4079539]: (4079539-09) (!!)ERROR sql_storage: too many retries on storing final, info not saved

From Mail.log
amavis[3188766]: (3188766-05) (!)WARN save_info_final: sql exec: err=7, 22P05, DBD::Pg::st execute failed: ERROR: character with byte sequence 0xe2 0x9a 0xa1 in encoding "UTF8" has no equivalent in encoding "LATIN1" at (eval 109) line 173.

Expected behavior

Psql default encoding should be hardcoded to utf8 either by seeing it per user or via the /etc/postgresql/12/main/postgresql.conf file

client_encoding = 'UTF8'

Without that being set, the default is set to auto, which will = latin1
Will update with better info once i am back at my laptop

@Spitfireap Spitfireap added bug postgres PostgreSQL labels Mar 10, 2023
@Spitfireap
Copy link
Member

Hi,

wouldn't be easier to edit createdb command and adding -E UTF8 ?

@JReming85
Copy link
Author

Sounds like that would be easier, as long as it honored it and only wrote in UTF8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug postgres PostgreSQL
Projects
None yet
Development

No branches or pull requests

2 participants