Home > Software engineering >  psycopg2 not compatible with postgres14 Mac OS Big Sur
psycopg2 not compatible with postgres14 Mac OS Big Sur

Time:10-09

I did a brew update the other day that updated my postgres version from 13 to 14 which caused me to get this error with psycopg2

psycopg2.errors.UndefinedFunction: function array_cat(anyarray, anyarray) does not exist

It took me a while to figure out what was going on but downgrading to postgres@13 fixed the issue. I couldn't find any information on what versions of postgres psycopg2 is compatible with but it sure seems like it doesn't work with postgres@14 can anyone confirm this or point me to supported versions in psycopg2?

CodePudding user response:

This mailing list thread quotes the Postgresql 14 release notes which say

User-defined objects that reference certain built-in array functions along with their argument types must be recreated (Tom Lane)

Specifically, array_append(), array_prepend(), array_cat(), array_position(), array_positions(), array_remove(), array_replace(), and width_bucket() used to take anyarray arguments but now take anycompatiblearray. Therefore, user-defined objects like aggregates and operators that reference those array function signatures must be dropped before upgrading, and recreated once the upgrade completes.

So if you have any user-defined functions that reference array_cat, that sounds like it.

  • Related