Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 32B3A2E017B for ; Fri, 7 Dec 2007 22:52:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 02251-07 for ; Fri, 7 Dec 2007 22:51:59 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 65E272E1FFA for ; Fri, 7 Dec 2007 22:52:05 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lB82pt5d002255; Fri, 7 Dec 2007 21:51:56 -0500 (EST) To: Oliver Jowett cc: sulfinu@gmail.com, pgsql-jdbc@postgresql.org Subject: Re: JDBC driver patch for non-ASCII users In-reply-to: <475A0286.706@opencloud.com> References: <200712071448.21411.sulfinu@gmail.com> <475A0286.706@opencloud.com> Comments: In-reply-to Oliver Jowett message dated "Sat, 08 Dec 2007 15:33:42 +1300" Date: Fri, 07 Dec 2007 21:51:55 -0500 Message-ID: <2254.1197082315@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/60 X-Sequence-Number: 17915 Oliver Jowett 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