pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedts_parse reports different between MacOS, FreeBSD/Linux
2+ messages / 2 participants
[nested] [flat]
* ts_parse reports different between MacOS, FreeBSD/Linux
@ 2020-12-22 18:15 Mark Felder <feld@FreeBSD.org>
2020-12-22 18:46 ` Re: ts_parse reports different between MacOS, FreeBSD/Linux Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Mark Felder @ 2020-12-22 18:15 UTC (permalink / raw)
To: pgsql-general
Hello,
We have an application whose test suite fails on MacOS when running the search tests on unicode characters.
I've narrowed it down to the following:
macos=# select * from ts_parse('default','天');
tokid | token
-------+-------
12 | 天
(1 row)
freebsd=# select * from ts_parse('default','天');
tokid | token
-------+-------
2 | 天
(1 row)
This has been bugging me for a while, but it's a test our devs using MacOS just ignores for now as we know it passes our CI/CD pipeline on FreeBSD/Linux. It seems if anyone is shipping an app on MacOS and bundling Postgres they're going to have a bad time with searching.
Please let me know if there's anything I can do to help. Will gladly test patches.
Thanks,
--
Mark Felder
ports-secteam & portmgr alumni
feld@FreeBSD.org
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: ts_parse reports different between MacOS, FreeBSD/Linux
2020-12-22 18:15 ts_parse reports different between MacOS, FreeBSD/Linux Mark Felder <feld@FreeBSD.org>
@ 2020-12-22 18:46 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2020-12-22 18:46 UTC (permalink / raw)
To: Mark Felder <feld@FreeBSD.org>; +Cc: pgsql-general
"Mark Felder" <feld@FreeBSD.org> writes:
> We have an application whose test suite fails on MacOS when running the search tests on unicode characters.
Yeah, known problem :-(. The text search parser relies on the C library's
locale data to classify characters as being letters, digits, etc.
Unfortunately, the UTF8 locales on macOS are just horribly bad, and
report many results that are different from other platforms.
I suppose that Apple has got reasonable Unicode character knowledge
somewhere in their OS; they are just not very interested in making the
POSIX locale APIs work well. Which leaves us with a bit of a problem
for getting consistent results cross-platform.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-12-22 18:46 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22 18:15 ts_parse reports different between MacOS, FreeBSD/Linux Mark Felder <feld@FreeBSD.org>
2020-12-22 18:46 ` Tom Lane <tgl@sss.pgh.pa.us>
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