Opened 12 years ago

Closed 6 months ago

#33145 closed enhancement (fixed)

postgresql90,postgresql91 improvement to Unicode support

Reported by: mail_ben_schmidt@… Owned by: jyrkiwahlstedt
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: cooljeanius (Eric Gallager)
Port: postgresql90 postgresql91

Description

Because Mac OS X's POSIX locale support is flakey, PostgreSQL does not sort UTF-8 text properly (or do other character and collation-related operations properly). FreeBSD suffers from the same problem.

A workaround is to patch PostgreSQL to use the ICU library (http://site.icu-project.org/) instead of the system's locale-related functions. FreeBSD have done this (http://people.freebsd.org/~girgen/postgresql-icu/README.html). PostgreSQL then works properly.

I have updated the Portfiles for the postgresql90 and postgresql91 ports, and updated and added the patches to do this.

There are a few deficiencies:

  • Autoconf now needs to be run, but the version has been changed (which isn't recommended by PostgreSQL) and is hardcoded to the version currently in MacPorts (so will break once the autoconf port moves to a new version). It would be better to make MacPorts use autoconf 2.63 (which, after all, is available as a port), and we won't have this problem. (We also won't need the uuid-related update.)
  • It would be good to have a better way of testing for the ICU library in ./configure rather than hardcoding in library symbols to search for that are specific to the library version (and thus will break as soon as the ICU port is updated).
  • ICU should perhaps be a variant (quite possibly it should be the default variant, but still, perhaps a variant is best rather than always using it).

I am happy to help address these (or other) problems, but I wanted to raise the issue first, and find out what you maintainers think before proceeding any further.

Hopefully we can get the patch applied upstream, too, and then MacPorts need only supply appropriate configure options and dependencies. But I think it's best to get it working with the patch in MacPorts first.

Attachments (2)

postgresql90.diff (19.8 KB) - added by mail_ben_schmidt@… 12 years ago.
postgresql91.diff (20.0 KB) - added by mail_ben_schmidt@… 12 years ago.

Download all attachments as: .zip

Change History (12)

Changed 12 years ago by mail_ben_schmidt@…

Attachment: postgresql90.diff added

Changed 12 years ago by mail_ben_schmidt@…

Attachment: postgresql91.diff added

comment:1 Changed 12 years ago by mail_ben_schmidt@…

I have updated the patch to address the autoconf version and variant issues.

A better way of testing for the ICU library might still be nice. I found this which may help: http://ac-archive.sourceforge.net/ac-archive/ac_check_icu.html

I'm also not 100% sure the patch is only effective for Unicode and doesn't mess up other multi-byte encodings. Still, now it's a variant, if it does mess something up, users can just turn it off. I did make the variant the default, though, as I expect most users will just be pleased that Unicode works as advertised. People might not even realise the issue has been addressed if the only change is a quietly added variant. Better to 'advertise' the new functionality by making it the default; if it breaks for some people, they'll soon find the problem and disable the variant. IMHO.

Not sure how likely this is to get merged upstream on account of this discussion: http://archives.postgresql.org/pgsql-general/2010-01/msg00535.php but I'm still hopeful.

comment:2 Changed 12 years ago by danielluke (Daniel J. Luke)

It looks like it would probably also be useful to file a bug report with apple (with the hope that the POSIX locale support could be fixed there at some point).

comment:3 Changed 11 years ago by mf2k (Frank Schima)

Port: postgresql90,postgresql91postgresql90 postgresql91
Version: 2.0.3

comment:4 Changed 9 years ago by mkoula (Miroslav Koula)

Anything changed? Because I still have the problem even on 9.3 or 9.4 with sorting. On FreeBSD is now possible to compile it with --with-icu parameter, but MacPorts still missing this possibility... Would be possible to update the patch even for the new versions?

comment:5 Changed 9 years ago by mf2k (Frank Schima)

Cc: mww@… removed
Owner: changed from macports-tickets@… to mww@…

comment:6 Changed 9 years ago by mail_ben_schmidt@…

I did update the patch just a couple of weeks ago to work with the current version of ICU (the old/nasty way). But that was still for Postgres 9.1. The upstream patch has been maintained, though, I believe, to work with later Postgres versions, so it shouldn't be hard to update for MacPorts, too. But it's only worth doing if it can actually get committed. Judging from the activity on this ticket, the old one never was. I don't have commit access, and in my experience, it's pretty hard to get someone who does have access to do it (which is why I rarely contribute to MacPorts, even though I'm listed as the maintainer of a few ports). If someone with commit access is interested in getting this committed, and would like my assistance, I'm happy to try to help.

comment:7 Changed 7 years ago by mf2k (Frank Schima)

Cc: jyrkiwahlstedt removed
Owner: changed from mww@… to jyrkiwahlstedt
Status: newassigned

comment:8 Changed 5 years ago by jmroot (Joshua Root)

I notice postgresql11 has a dependency on icu. Does this mean the issue has been fixed upstream? And does that mean this ticket is adequately resolved, or do some older versions still need to have a variant added?

9.0 and 9.1 are well and truly EOL in any case.

comment:9 Changed 3 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:10 Changed 6 months ago by dgilman (David Gilman)

Resolution: fixed
Status: assignedclosed

In bfbd57e500d63729bd89d599cfc23b3232abf387/macports-ports (master):

postgresql16: new port

Closes: #40501
Closes: #37929
Closes: #36511
Closes: #36128
Closes: #33145
Closes: #66529
Closes: #67638
Closes: #29752
Closes: #66689
Closes: #67203
Closes: #67713
Closes: #68119
Closes: #67339

Note: See TracTickets for help on using tickets.