Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VOwSK-0007TD-Ls for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Sep 2013 21:17:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VOwSK-0008NA-4W for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Sep 2013 21:17:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VOwSH-0008L2-TS for pgsql-hackers@postgresql.org; Wed, 25 Sep 2013 21:17:06 +0000 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VOwSA-000108-Tk; Wed, 25 Sep 2013 21:17:05 +0000 Received: by mail-pa0-f43.google.com with SMTP id hz1so360713pad.30 for ; Wed, 25 Sep 2013 14:16:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:cc:references:in-reply-to:subject:date :mime-version:content-type:content-transfer-encoding; bh=DnKA5BWJftutIUkWXIis2uiMSPvH5B4UK4HxonH1ukQ=; b=O2uqB2BbesoCCOhN4Yw158N3Odsex19+61gEpe9JKN9XLx7KhdLNpaXqLOQdCGkKlt Y3KDGCz/pR/b6E8KxRdBoflo76WN7fgaZwQQ3N3vTTlFk2I3oZkfVSHzRn0oViD5ygnq +OGB9ijkG5dXYng5bNicr0mA9/BabC1nQQC48xg1WiPhrJMlDpTB/6HDfHuE0sFR0xaV vvYGds/767n9tMAjE8qqv72mNqNqj9Qezp9n/a0xhHaH5fAp74Zw6BIyBXfnQktFYeus kbPNsOJAnwCU6hnzJMuipnSp+J/6S7eEbmZ0rwhxBtEqNZ3KzJY5K7D8DY2OTUHKjLgw pYpQ== X-Received: by 10.67.14.67 with SMTP id fe3mr1422511pad.134.1380143816745; Wed, 25 Sep 2013 14:16:56 -0700 (PDT) Received: from maumau (p6019-ipbfp211sizuokaden.shizuoka.ocn.ne.jp. [114.170.213.19]) by mx.google.com with ESMTPSA id xs1sm74176pac.7.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 25 Sep 2013 14:16:55 -0700 (PDT) Message-ID: <7C2A735AFC3E4088A8F49B677855369C@maumau> From: "MauMau" To: "Greg Stark" Cc: "Peter Eisentraut" , "Robert Haas" , "Tatsuo Ishii" , "Tom Lane" , , "Heikki Linnakangas" , "PostgreSQL-development" References: <20130920.085853.1628917054830864151.t-ishii@sraoss.co.jp> <20130922.072952.1977066018971837040.t-ishii@sraoss.co.jp> <5240B212.8040307@gmx.net> <7DCFAE8265254605840917B35EEF09F1@maumau> In-Reply-To: Subject: Re: UTF8 national character data type support WIP patch and list of open issues. Date: Thu, 26 Sep 2013 06:18:10 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6002.18197 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18463 X-Pg-Spam-Score: -1.3 (-) 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 From: "Greg Stark" > If it's not lossy then what's the point? From the client's point of view > it'll be functionally equivalent to text then. Sorry, what Tatsuo san suggested meant was "same or compatible", not lossy. I quote the relevant part below. This is enough for the use case I mentioned in my previous mail several hours ago (actually, that is what Oracle manual describes...). http://www.postgresql.org/message-id/20130920.085853.1628917054830864151.t-ishii@sraoss.co.jp [Excerpt] ---------------------------------------- What about limiting to use NCHAR with a database which has same encoding or "compatible" encoding (on which the encoding conversion is defined)? This way, NCHAR text can be automatically converted from NCHAR to the database encoding in the server side thus we can treat NCHAR exactly same as CHAR afterward. I suppose what encoding is used for NCHAR should be defined in initdb time or creation of the database (if we allow this, we need to add a new column to know what encoding is used for NCHAR). For example, "CREATE TABLE t1(t NCHAR(10))" will succeed if NCHAR is UTF-8 and database encoding is UTF-8. Even succeed if NCHAR is SHIFT-JIS and database encoding is UTF-8 because there is a conversion between UTF-8 and SHIFT-JIS. However will not succeed if NCHAR is SHIFT-JIS and database encoding is ISO-8859-1 because there's no conversion between them. ---------------------------------------- Regards MauMau -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers