Re: v3 protocol & string encoding - Mailing list pgsql-hackers

From Tom Lane
Subject Re: v3 protocol & string encoding
Date
Msg-id 15424.1085931146@sss.pgh.pa.us
Whole thread Raw
In response to v3 protocol & string encoding  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: v3 protocol & string encoding  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-hackers
Oliver Jowett <oliver@opencloud.com> writes:
> 1) What encoding is used for strings sent and received during the 
> startup phase?

The startup packet itself will not get any encoding conversion AFAIR,
so one way to look at it is that the data therein must be in server
encoding.  In practice, there are no strings therein that really need
conversion anyway.  (If you use characters outside 7-bit-ASCII for user
or database names, you're going to have much worse problems than just
this one.)

Any client_encoding received from the client is not going to be applied
until after the authentication exchange is complete, so the rest of that
is going to be in server encoding as well.  The only part of this that
seems like it might be an issue is a failure ERROR message would be in
server encoding, but the client wouldn't have any good way to know what
that is ...

> 2) At what point in the stream does a client_encoding change take effect 
> -- immediately after the corresponding ParameterStatus message, or at 
> some other point?

ParameterStatus is sent when the change is made.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: CVS tip compiler error with --enable-thread-safety
Next
From: Tom Lane
Date:
Subject: Re: Converting postgresql.conf parameters to kilobytes