pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Oliver Jowett <oliver@opencloud.com>
Cc: sulfinu@gmail.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC driver patch for non-ASCII users
Date: Fri, 07 Dec 2007 21:51:55 -0500
Message-ID: <2254.1197082315@sss.pgh.pa.us> (raw)
In-Reply-To: <475A0286.706@opencloud.com>
References: <200712071448.21411.sulfinu@gmail.com>
	<475A0286.706@opencloud.com>

Oliver Jowett <oliver@opencloud.com> writes:
> I would also be a lot happier if the protocol specification docs were 
> updated to reflect whatever the current "approved" way of doing 
> non-ASCII authentication info is before the driver started making 
> assumptions about it.

That's a bit hard, because the real problem here is that there isn't any
"approved" way of dealing with this.  The short and unpleasant answer is
that if you put any non-7-bit-ASCII characters into shared system
catalogs (not only pg_authid, but pg_database and pg_tablespace),
You Are On Your Own.  When it breaks, you get to keep both pieces.

Given the current design that allows different databases in a cluster
to (claim they) have different encodings, it's real hard to see how
to handle non-ASCII data in shared catalogs sanely.  I don't think
we'll really be able to fix this properly until that mythical day
when we have support for per-column encoding selections.  My guess
is that we'd then legislate that shared catalog columns are always
UTF8; after which we could start to think about what it would take
to do conversion of the connection startup packet's contents from
client-side encoding to UTF8.

Right now it's all pretty broken, and I really question whether it's
sane to put workarounds like this proposed patch into client-side
drivers.  If you aren't consistent about the encoding you use for
non-ASCII usernames, you're going to lose somewhere along the line
anyway.  So why not just recommend that people do that?

			regards, tom lane



view thread (17+ messages)  latest in thread

Message-ID: <2254.1197082315@sss.pgh.pa.us>
Permalink:  ../2254.1197082315@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2254.1197082315@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, oliver@opencloud.com, sulfinu@gmail.com
  Subject: Re: JDBC driver patch for non-ASCII users
  In-Reply-To: <2254.1197082315@sss.pgh.pa.us>
  References: <200712071448.21411.sulfinu@gmail.com> <475A0286.706@opencloud.com> <2254.1197082315@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox