Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gucOp-0003vX-86 for pgsql-bugs@arkaria.postgresql.org; Fri, 15 Feb 2019 12:15:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gucOn-00044i-Qm for pgsql-bugs@arkaria.postgresql.org; Fri, 15 Feb 2019 12:15:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gucOn-00043c-Go for pgsql-bugs@lists.postgresql.org; Fri, 15 Feb 2019 12:15:21 +0000 Received: from mx02.clickware.de ([195.14.243.120]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gucOf-0006qX-Kn for pgsql-bugs@lists.postgresql.org; Fri, 15 Feb 2019 12:15:20 +0000 Received: from mx02.clickware.de (127.0.0.1) id hcqmlu0171s1 for ; Fri, 15 Feb 2019 13:15:24 +0100 (envelope-from ) Received: from postfix2015.clickware.de ([192.168.2.140]) by mx02.clickware.de ([192.168.2.145]) (spamfilter) with ESMTPS (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256/256) id o201902151215240002905-5; Fri, 15 Feb 2019 13:15:24 +0100 Received: from [192.168.1.237] (unknown [192.168.1.237]) by postfix2015.clickware.de (Postfix) with ESMTPSA id 544951F8000A for ; Fri, 15 Feb 2019 13:15:22 +0100 (CET) Subject: =?UTF-8?Q?Re=3a_BUG_=2315637=3a_Problem_insert_data_=e3=80=90Japane?= =?UTF-8?B?c2XjgJE=?= To: pgsql-bugs@lists.postgresql.org References: <15637-4189f44523cbafd9@postgresql.org> From: Marc Schablewski Message-ID: Date: Fri, 15 Feb 2019 13:15:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <15637-4189f44523cbafd9@postgresql.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: de-DE X-Mlf-Version: 9.2.1.5025 X-Mlf-License: BSVKCAP___ X-Mlf-UniqueId: o201902151215240002905 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Am 15.02.2019 um 03:43 schrieb PG Bug reporting form: > I created table has a column 【"C_VAL" character varying(10)】 after that I > insert data【'不具合管理報告書': length=24】. It was inserted successfully => this is > problem. > * Details: > -- Step 1: Create table. Data length of "C_VAL" column = 10 > create table "USER02"."T_331_VARCHAR" ( > "ID" numeric not null > , "C_VAL" character varying(10) > , primary key ("ID") > ); > -- Step 2: Check data length. OCTET_LENGTH('不具合管理報告書') = 24 > SELECT OCTET_LENGTH('不具合管理報告書'); > -- Step 3: Insert data. Length '不具合管理報告書' = 24 > INSERT INTO "USER02"."T_331_VARCHAR"("ID", "C_VAL") > VALUES(1,'不具合管理報告書'); > -- Step 4: Check length of inserted data > SELECT OCTET_LENGTH("C_VAL"), * FROM "USER02"."T_331_VARCHAR"; > => Why 【Step 3】was successful ?. Can you help me ? > Thank you ! I think it works because a multibyte character is still considered a single character, even if it is represented internally with more than one byte. This means your octet_length() can be bigger than the character length of your string returned by length(). The string in your example is still only 8 characters and should fit into your colum. Marc