Re: String encoding during connection "handshake" - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: String encoding during connection "handshake"
Date
Msg-id 20071128152037.GD31742@svana.org
Whole thread Raw
In response to Re: String encoding during connection "handshake"  (sulfinu@gmail.com)
Responses Re: String encoding during connection "handshake"
List pgsql-hackers
On Wed, Nov 28, 2007 at 11:39:33AM +0200, sulfinu@gmail.com wrote:
> During the authentication phase, no such conversion takes place - you were
> right and I couldn't believe it! In the case when your database name, your
> user name or password contain non-ASCII characters, you're out of luck if the
> stored values were submitted in another encoding by the administrator.

The problem is, what conversion. You don't know the encoding of the
server yet (because you havn't selected a DB) and you don't know the
encoding to the client. The only real possibility is to declare One
True Encoding and decree every username/password be in that. But you're
never going to get people to agree on that.

> I assume that no names conversion takes place between client and cluster
> metadata when a role is created (CREATE ROLE... PASSWORD...) or when a
> database is created (CREATE DATABASE...). Or does it? In that case, the names
> are encoded in the encoding of the database that the administrator was
> connected to.

Honestly, UNIX usernames/passwords have always worked like this so
we're not really doing anything wierd by doing it this way. Users need
to type the password in the same encoding it was added. It not usually
a big deal because people set their own passwords...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: pgwin32_open returning EINVAL
Next
From: Alvaro Herrera
Date:
Subject: Re: pgwin32_open returning EINVAL