Code review comment for lp:~cjwatson/launchpad/db-distroseries-publishing-options

Revision history for this message
Colin Watson (cjwatson) wrote :

With a json column, queries that involve SELECT DISTINCT on a whole DistroSeries row now result in:

  ProgrammingError: could not identify an equality operator for type json

It's at least slightly arguable that that's a Storm bug; it would surely be more efficient for it to turn it into DISTINCT ON (primary key). But it's not too difficult to work around this by using ResultSet.config(distinct=(DistroSeries.id, ...)), and in the meantime this does in fact point out a real bug: we can't rely on the order of JSON serialisation. So I'd definitely like to move to the json type because it makes it harder to make that kind of mistake.

However, moving to the json type requires upgrading to psycopg2 >= 2.5, which knows how to deserialise it; and that causes us to run into https://bugs.launchpad.net/storm/+bug/1170063. I've proposed a patch for that and am currently running the Launchpad test suite with psycopg2 2.6.1 and a cherry-pick of that patch onto the Launchpad branch of Storm.

« Back to merge proposal