NeonN
Neon13mo ago
2 replies
urgent-maroon

Answered: Unexpected behavior with pg_trgm and special characters

Hello guys. First, thanks for the awesome work.
I have encountered some inconsistency regarding the pg_tgrm extension on Neon.

When I use the show_trgm, it has weird behaviors when using Japanese characters:

Example with no special characters: Works normally.
SELECT show_trgm('res'), show_trgm('very interesting place'), similarity('res', 'very interesting place');

#    show_trgm            show_trgm                                                                                                    similarity
1    {" r"," re","es ",res}    {" i"," p"," v"," in"," pl"," ve",ace,"ce ",ere,ery,est,ing,int,lac,"ng ",nte,pla,res,"ry ",sti,ter,tin,ver}    0.03846154


Example with japanese characters: Skips everything in Neon.
SELECT show_trgm(''), show_trgm(''), similarity('', '');

Neon:
#    show_trgm    show_trgm    similarity
1    {}            {}            0


My Docker PgSQL:
show_trgm                            show_trgm                                                                                    similarity
{0xb55e8b,0xc4530f,0x0b774a,0x74c091}   {0x9176bd,0x920e92,0x960770,0xbe019e,0xed92a2,0xf9c014,0x14dccf,0x6fc655,0x74c091}            0.083333336


When I switched my staging environment from Neon to a normal PostgreSQL in Docker, it worked without any problems.

Please, is there any configuration that I can do in Neon to support special and Japanese characters.
Thank you in advance.
Will
Was this page helpful?