You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When upgrading a cluster from PostgreSQL 12 to 15 using pg_upgrade, the data added via ALTER OPERATOR FAMILY integer_ops is lost. This happens with no warning or error. Easily reproducible with a database that only has CREATE EXTENSION uint;. I'm unsure if this is specific to these versions, or a problem in general with upgrading.
One way to check if a database has been affected is to run \dAp in psql, and then do a / search for btint1uint1cmp. If it's missing, then the operator family information has been lost.
This can be fixed by running psql -f /usr/share/postgresql/{version}/extension/uint--0.sql, or wherever the extension is installed. Definitely not ideal though. All queries in that command will fail except for the two ALTER OPERATOR FAMILY queries near the end.
We discovered this by chance when observing poor query plans when using a uint1 as a partition key on a partitioned table. Queries with where partition_key=1 (for example) would not plan properly, since the = operator was no longer a member of the operator family. (Similar case on SO here, but unrelated to pguint).
The text was updated successfully, but these errors were encountered:
When upgrading a cluster from PostgreSQL 12 to 15 using
pg_upgrade
, the data added viaALTER OPERATOR FAMILY integer_ops
is lost. This happens with no warning or error. Easily reproducible with a database that only hasCREATE EXTENSION uint;
. I'm unsure if this is specific to these versions, or a problem in general with upgrading.One way to check if a database has been affected is to run
\dAp
inpsql
, and then do a/
search forbtint1uint1cmp
. If it's missing, then the operator family information has been lost.This can be fixed by running
psql -f /usr/share/postgresql/{version}/extension/uint--0.sql
, or wherever the extension is installed. Definitely not ideal though. All queries in that command will fail except for the twoALTER OPERATOR FAMILY
queries near the end.We discovered this by chance when observing poor query plans when using a
uint1
as a partition key on a partitioned table. Queries withwhere partition_key=1
(for example) would not plan properly, since the=
operator was no longer a member of the operator family. (Similar case on SO here, but unrelated to pguint).The text was updated successfully, but these errors were encountered: