Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VMHcB-0004Yh-3I for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Sep 2013 13:16:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VMHcA-00081t-HS for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Sep 2013 13:16:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VMHc8-0007zx-Ff for pgsql-hackers@postgresql.org; Wed, 18 Sep 2013 13:16:16 +0000 Received: from mail-ob0-x22c.google.com ([2607:f8b0:4003:c01::22c]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VMHc4-00030M-Lg for pgsql-hackers@postgresql.org; Wed, 18 Sep 2013 13:16:16 +0000 Received: by mail-ob0-f172.google.com with SMTP id gq1so7588192obb.31 for ; Wed, 18 Sep 2013 06:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=rUa6aHJKkPsWfkgO9eK6NFmLeQDtFbQeneg82LJuwus=; b=opLY9aHKGdFV7jmO4TRgChd5E5eYXrkAowensysoCeLWE2JuZWyrPrcVCADrdevlPj 6cuyr8/KhIyaZBhGhUJ+sWQqy01osbAm/TSusQ8mZfd7ZoDbmluXtq+2N3YyVWTydAZv 1z5C5Wahe84XH4hUD0j1zK+NlroKvCfD4+X8KxtdmJ2RatOwKf1SGsoRVdGFhOPwX32O MeXxZ2NiPYcDk9Bb34+9hKwLCh3166V5VNIe5KTE6aj3j2YgXYveTaDKhS4yhKwJTOiQ u+SwM55qrBF8NV5/aI9KUHBC49sjBvNWQm3CO+bUKlFV6wIXeZWaERQGVQHpF/7HQgtI GeAg== MIME-Version: 1.0 X-Received: by 10.182.129.201 with SMTP id ny9mr34725789obb.0.1379510171100; Wed, 18 Sep 2013 06:16:11 -0700 (PDT) Received: by 10.60.50.100 with HTTP; Wed, 18 Sep 2013 06:16:11 -0700 (PDT) In-Reply-To: References: <522594E8.2050106@vmware.com> <904.1378304922@sss.pgh.pa.us> Date: Wed, 18 Sep 2013 09:16:11 -0400 Message-ID: Subject: Re: UTF8 national character data type support WIP patch and list of open issues. From: Robert Haas To: MauMau Cc: Tom Lane , "Boguk, Maksym" , Heikki Linnakangas , "pgsql-hackers@postgresql.org" Content-Type: text/plain; charset=ISO-8859-1 X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Mon, Sep 16, 2013 at 8:49 AM, MauMau wrote: > 2. NCHAR/NVARCHAR columns can be used in non-UTF-8 databases and always > contain Unicode data. ... > 3. Store strings in UTF-16 encoding in NCHAR/NVARCHAR columns. > Fixed-width encoding may allow faster string manipulation as described in > Oracle's manual. But I'm not sure about this, because UTF-16 is not a real > fixed-width encoding due to supplementary characters. It seems to me that these two points here are the real core of your proposal. The rest is just syntactic sugar. Let me start with the second one: I don't think there's likely to be any benefit in using UTF-16 as the internal encoding. In fact, I think it's likely to make things quite a bit more complicated, because we have a lot of code that assumes that server encodings have certain properties that UTF-16 doesn't - specifically, that any byte with the high-bit clear represents the corresponding ASCII character. As to the first one, if we're going to go to the (substantial) trouble of building infrastructure to allow a database to store data in multiple encodings, why limit it to storing UTF-8 in non-UTF-8 databases? What about storing SHIFT-JIS in UTF-8 databases, or Windows-yourfavoriteM$codepagehere in UTF-8 databases, or any other combination you might care to name? Whether we go that way or not, I think storing data in one encoding in a database with a different encoding is going to be pretty tricky and require far-reaching changes. You haven't mentioned any of those issues or discussed how you would solve them. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers