Re: [HACKERS] Optional message to user when terminating/cancellingbackend - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: [HACKERS] Optional message to user when terminating/cancellingbackend
Date
Msg-id CB576655-AF5D-4EDD-827F-88EE39CFF32A@yesql.se
Whole thread Raw
In response to Re: [HACKERS] Optional message to user when terminating/cancellingbackend  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: [HACKERS] Optional message to user when terminating/cancelling backend
Re: [HACKERS] Optional message to user when terminating/cancelling backend
List pgsql-hackers
> On 6 Aug 2018, at 09:47, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
>
> Has there been any consideration to encodings?

Thats a good point, no =/

> What happens if the message contains non-ASCII characters, and the sending backend is connected to database that uses
adifferent encoding than the backend being signaled? 

In the current state of the patch, instead of the message you get:

    FATAL: character with byte sequence 0xe3 0x82 0xbd in encoding "UTF8" has
           no equivalent in encoding “ISO_8859_5"

Thats clearly not good enough, but I’m not entirely sure what would be the best
way forward.  Restrict messages to only be in SQL_ASCII?  Store the encoding of
the message and check the encoding of the receiving backend before issuing it
for a valid conversion, falling back to no message in case there is none?
Neither seems terribly appealing, do you have any better suggestions?

cheers ./daniel

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Facility for detecting insecure object naming
Next
From: Andrew Dunstan
Date:
Subject: Re: NetBSD vs libxml2