Skip to content

Switch to psycopg 3

Part the First of https://redmine.teklia.com/issues/10050

  • All psycopg2 imports are renamed to psycopg, fortunately the modules did not move.
  • psycopg2.extras.execute_values does not exist anymore, so I had to make the cursed has_children SQL on element lists even more cursed than before.
  • psycopg does not support tuples as parameters for a IN %s construct, so I also had to make the ListDatasetElements neighbors SQL even more cursed.
  • The syntax for arrays changed from ARRAY['a', 'b', 'c'] to '{a,b,c}'::text[]. It used to be the {} syntax a while ago, then something changed it to ARRAY[] (maybe Django 5, I forgot), and brackets are back. 🤷
  • UUIDs are now serialized without dashes, to save four characters, so I had to update basically every assertExactQueries call.

Base image build: https://gitlab.teklia.com/arkindex/backend/-/jobs/707340

Merge request reports

Loading