Sunday, February 6, 2011

Squeeze + PostgreSQL = Broken

The PostgreSQL package in Debian squeeze, just released, is linked with libedit instead of libreadline. This has two interesting properties:
If either of these is a concern, think carefully before you upgrade.

Is there a way to at least configure libedit to accept non-ASCII characters?

19 comments:

  1. Wow, nice. Or, actually, not very. Do you know *why* they'd switch to libedit? I thought readline worked perfectly fine, and it's not like debian has something against GPL style licenses...

    In general it seems their quality control certainly leaves some wanting...

    ReplyDelete
  2. Seems that it was this change to the debian package that is to blame:
    postgresql-8.4 (8.4.5-2) unstable; urgency=low

    * debian/control: Build against libedit instead of libreadline. We can't
    simultaneously link against readline (GPL) and libssl (incompatible with
    GPL). (Closes: #603598)

    -- Martin Pitt Wed, 17 Nov 2010 18:02:46 +0100

    ReplyDelete
  3. Under OSX it accepts UTF-8 characters, but produces very weird characters, send to the backend:

    bernd@localhost:bernd #= CREATE TABLE äöü(id int);
    CREATE TABLE
    Time: 147,188 ms
    bernd@localhost:bernd #= \d
    List of relations
    Schema | Name | Type | Owner
    --------+------+-------+-------
    public | | table | bernd
    (1 row)

    bernd@localhost:bernd #= ^D\q

    Not sure, but it seems there's is a generic problem here.

    Ah...looking at their homepage, the latest upstream release seems to work with UTF-8, according to the changelog. Seems to be worth trying.

    ReplyDelete
  4. Um, no, trying the latest libedit release 0:35:0 with configure option --enable-widec leads to the behavior Peter observed. If you omit that option (which Apple does for example), it produces broken characters on non-ASCII input.

    ReplyDelete
  5. So Debian solved a license issue by actually introducing a bug?
    Things are getting worse in Debian.

    ReplyDelete
  6. Seems like this is a nasty interfacing ideological bug:

    http://people.gnome.org/~markmc/openssl-and-the-gpl.html
    http://lists.debian.org/debian-legal/2002/10/msg00113.html

    Maybe libssl can be replaced by GNU TLS:
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=501145#10

    ReplyDelete
  7. We're not even to the bottom yet of all the bugs that the license change introduced by http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=603599 has added. On top of the two Peter linked to there's also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=607907

    As of two days ago we are already building custom debs for angry clients on Squeeze to put readline back again; there's instructions at the bottom of the report for #607907 for one work-around, linking to it while disabling SSL support.

    Unfortunately, I think that working out all the issues with libedit may actually be the right long-term move here, given the license issues. That's what we had to do at...uh, somewhere I shouldn't talk about. Let's just say that commercial forks of the PostgreSQL code have been facing this problem for a while now, and the easiest way out can be switching to libedit.

    ReplyDelete
  8. A little tip i discovered in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=601754:

    libedit can be bypassed by launching psql this way
    LD_PRELOAD=/lib/libreadline.so.6 psql

    ReplyDelete
  9. i hold 9.0.1 client.
    but you can ignore the psql-history with "-n" and use rlwrap instead (without tab-completion).
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=607109#15

    ReplyDelete
  10. @Andreas, yes it's far from ideal. However it would be _illegal_ to ship it otherwise. "Things getting worse in Debian", no, Debian has always cared about ensuring that the law is followed.

    Perhaps "people not understanding is getting worse" would have been more accurate. Yes, I get fed up with Debian getting blame when they point out genuine problems (e.g. iceweasel/firefox, KDE/Qt/GPL, etc)

    ReplyDelete
  11. Wasn't the iceweasel problem caused by Debian doing it's usual overzealous patch-the-crap-out-of-upstream-projects? That's a debian problem, not a firefox problem.

    ReplyDelete
  12. Please ignore the trolls. I am anxiously waiting for postgresql 9 to hit squeeze-backports. Hope this is an easy fix, and thanks to the OP for bringing this problem up!

    ReplyDelete
  13. Writing a _RANT_ to

    mpitt@debian.org the person that thought that building against libedit, with out fixing the resulting bugs was a fix to classic debian licencing madness.

    Copied to viiru@debian.org the person that thought that the licencing issue was a _SERIOUS_ bug vs the package not working.

    ReplyDelete
  14. latest postgresql-common in debian/sid works around the issue !

    ReplyDelete
  15. The linking issue with openssl has got to be one of the stupidest things I've seen them do. Right after the whole iceweasel and icedove debauchery that forced everybody into using google chrome for an updated browser. I think last time I checked there are between 400-500 packages built against libssl in debian main. The thing they have an issue with is simply sticking a link to openssl in the description for binaries built against libssl. For whatever reason I guess its 'bad' to have a one line link to openssl like all those other packages have. I think the maintainer should be thrown out of maintaining postgres.

    ReplyDelete
  16. Hi, is this still an issue in 2012-04 or did they fix the package? If not, do I have to use another package and which one is the best? Thanks!

    ReplyDelete
    Replies
    1. Squeeze is still broken, yes. Also, in wheezy, readline is loaded via LD_PRELOAD if available, but users could still be affected. Arguably, there mere fact that libedit still exists is a bug.

      Delete
    2. Thanks for your answer! Is the package in debian backports ok? Sorry, I am just occasionally exposed to the combination of debian + postgres and stumbled across this a little bit too late... thanks again for your attention!

      Delete
    3. You need postgresql-client-common >=114, so squeeze-backports is OK.

      Delete