How do I set PostgreSQL's application_name so that it doesn't get the "?" characters?

113 Views Asked by At

I have this UTF-8 string in PHP:

$test_title = 'My criticál business applicätiön';

If I send that to PostgreSQL to set the application_name, it then looks like this:

My critic?l business applic?ti?n

Is there a way to include characters outside of ASCII in a PostgreSQL client’s application_name?

1

There are 1 best solutions below

3
On

Use ASCII characters. It is spelled out here:

https://www.postgresql.org/docs/current/runtime-config-logging.html#GUC-APPLICATION-NAME

Only printable ASCII characters may be used in the application_name value. Other characters will be replaced with question marks (?).

For a recent (ongoing) thread on this see:

https://www.postgresql.org/message-id/MHDH6oj--3-2%40tutanota.com

It is point 1). Some of the follow up replies address this.