Re: String encoding during connection "handshake"

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: sulfinu(at)gmail(dot)com
Cc: Usama Munir <usama(dot)munir(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: String encoding during connection "handshake"
Date: 2007-11-28 15:20:37
Message-ID: 20071128152037.GD31742@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 28, 2007 at 11:39:33AM +0200, sulfinu(at)gmail(dot)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(at)svana(dot)org> http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
> -- John F Kennedy

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-11-28 15:24:26 Re: pgwin32_open returning EINVAL
Previous Message Martijn van Oosterhout 2007-11-28 15:12:58 Re: pgwin32_open returning EINVAL