From: | Francisco Olarte <folarte(at)peoplecall(dot)com> |
---|---|
To: | thanhhv26(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org |
Subject: | Re: BUG #15637: Problem insert data 【Japanese】 |
Date: | 2019-02-15 13:51:24 |
Message-ID: | CA+bJJbzM5J+bGYnxRyJvaoqrReHNEhqOKYikPtbgUZg1NpwzKw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On Fri, Feb 15, 2019 at 12:50 PM PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
It's been answered before, but..
> I created table has a column 【"C_VAL" character varying(10)】
The first sentence of the first paragraph of the "8.3 character types"
of the manual reads:
"SQL defines two primary character types: character varying(n) and
character(n), where n is a positive integer. Both of these types can
store strings up to n characters (not bytes) in length. "
> -- 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 ?
Try asking for the SQL standard
"char_length(string) or character_length(string) int Number of
characters in string char_length('jose')"
or the additional ( but the one which I mostly use )
"length(string) int Number of characters in string"
instead of the SQL standard
"octet_length(string) int Number of bytes in string"
( quoted from the first two tables of 9.4-String functions and operators)
( I suspect length is listed in the standard specifically to avoid
doubts about whether it returns bytes, chars or codepoints or whatever
)
Francisco Olarte.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2019-02-15 14:43:59 | Re: BUG #15631: Generated as identity field in a temporary table with on commit drop corrupts system catalogs |
Previous Message | Peter Eisentraut | 2019-02-15 13:02:58 | Re: BUG #15631: Generated as identity field in a temporary table with on commit drop corrupts system catalogs |