pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 荒井元成 <n2029@ndensan.co.jp>
To: 'Graham Myers' <gmyers@retailexpress.com>
To: 'David G. Johnston' <david.g.johnston@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: RE: About Unicode IVS
Date: Tue, 29 Mar 2022 17:52:45 +0900
Message-ID: <012001d8434a$5bf28150$13d783f0$@ndensan.co.jp> (raw)
In-Reply-To: <d60efdf8caa7379a7483cd530ba5098e@mail.gmail.com>
References: <00e201d8431c$cb38eb40$61aac1c0$@ndensan.co.jp>
	<CAKFQuwYCTmp5t5_7n+qRoKZArnBvv309CSi4XVdONXxQL6OX0Q@mail.gmail.com>
	<00f601d84326$5367cf00$fa376d00$@ndensan.co.jp>
	<ed987a765304d836fb05a9190eac46bf@mail.gmail.com>
	<011201d84345$f704a1f0$e50de5d0$@ndensan.co.jp>
	<d60efdf8caa7379a7483cd530ba5098e@mail.gmail.com>

Where should I make a request if I want Postgresql to handle it?

Is this mailing list all right?

 

Moto.

 

From: Graham Myers <gmyers@retailexpress.com> 
Sent: Tuesday, March 29, 2022 5:26 PM
To: 荒井元成 <n2029@ndensan.co.jp>; David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: RE: About Unicode IVS

 

Thanks you for the explanation, Unicode always blows my mind 😊  The problems is that postgres is counting code points which in your example is two.

 




	



Graham Myers​








 

From: 荒井元成 <n2029@ndensan.co.jp <mailto:n2029@ndensan.co.jp> > 
Sent: 29 March 2022 09:21
To: 'Graham Myers' <gmyers@retailexpress.com <mailto:gmyers@retailexpress.com> >; 'David G. Johnston' <david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com> >
Cc: pgsql-admin@lists.postgresql.org <mailto:pgsql-admin@lists.postgresql.org> 
Subject: RE: About Unicode IVS

 

thank you for your reply.

 

This is because two characters display one character.

This includes Unicode Variant Selectors and Combining Characters.

 

Moto.

 

From: Graham Myers <gmyers@retailexpress.com <mailto:gmyers@retailexpress.com> > 
Sent: Tuesday, March 29, 2022 4:46 PM
To: 荒井元成 <n2029@ndensan.co.jp <mailto:n2029@ndensan.co.jp> >; David G. Johnston <david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com> >
Cc: pgsql-admin@lists.postgresql.org <mailto:pgsql-admin@lists.postgresql.org> 
Subject: RE: About Unicode IVS

 

Why do you expect the concatenation of two characters to return a length of one?  

 




	



Graham Myers​








 

From: 荒井元成 <n2029@ndensan.co.jp <mailto:n2029@ndensan.co.jp> > 
Sent: 29 March 2022 05:35
To: 'David G. Johnston' <david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com> >
Cc: pgsql-admin@lists.postgresql.org <mailto:pgsql-admin@lists.postgresql.org> 
Subject: RE: About Unicode IVS

 

 

thank you for your reply.

It will be 2 characters.

 

select char_length(U&'\+008FBA' || U&'\+0E0102');

char_length

-------------

           2

(1 行)

 

select length('辺󠄂');

length

--------

      2

(1 行)

 

select char_length('辺󠄂');

char_length

-------------

           2

(1 行)

 

$ psql -l

                                      データベース一覧

   名前    | 所有者  | エンコーディング | 照合順序 | Ctype(変換演算子) |    アクセス権限

-----------+---------+------------------+----------+-------------------+---------------------

D209007   | D209007 | UTF8             | C        | C                 |

postgres  | D209007 | UTF8             | C        | C                 |

template0 | D209007 | UTF8             | C        | C                 | =c/D209007         +

           |         |                  |          |                   | D209007=CTc/D209007

template1 | D209007 | UTF8             | C        | C                 | =c/D209007         +

           |         |                  |          |                   | D209007=CTc/D209007

(4 行)

 

 

$ cat pgdata/PG_VERSION

13

 

Moto.

 

From: David G. Johnston <david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com> > 
Sent: Tuesday, March 29, 2022 12:38 PM
To: 荒井元成 <n2029@ndensan.co.jp <mailto:n2029@ndensan.co.jp> >
Cc: pgsql-admin@lists.postgresql.org <mailto:pgsql-admin@lists.postgresql.org> 
Subject: Re: About Unicode IVS

 



On Monday, March 28, 2022, 荒井元成 <n2029@ndensan.co.jp <mailto:n2029@ndensan.co.jp> > wrote:

Hi,

 

In the Length () function, it will be 2 characters where you want it to be 1 character.

Is it possible to respond by changing the settings such as changing the collation setting like SQL Server?
Also, if you understand how to deal with it (eg, create your own function), it would be helpful if you could provide as much information as you can.

 

 

Try char_length(text) instead.

 

David J.

 

Attachments:

image002.png (image/png, 3.1K) download view image
image003.png (image/png, 3.1K) download view image

view thread (13+ messages)  latest in thread

Message-ID: <012001d8434a$5bf28150$13d783f0$@ndensan.co.jp>
Permalink:  ../012001d8434a$5bf28150$13d783f0$@ndensan.co.jp/
Also on:    postgresql.org/message-id/012001d8434a$5bf28150$13d783f0$@ndensan.co.jp

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: n2029@ndensan.co.jp, gmyers@retailexpress.com, david.g.johnston@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: RE: About Unicode IVS
  In-Reply-To: <012001d8434a$5bf28150$13d783f0$@ndensan.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox