Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PG17 compatibility: fix pg16 to pg17 upgrade #7788

Open
wants to merge 2 commits into
base: naisila/pg17_support
Choose a base branch
from

Conversation

colm-mchugh
Copy link
Contributor

@colm-mchugh colm-mchugh commented Dec 13, 2024

In citus_prepapre_upgrade(), don't drop any_value when upgrading from PG16+, because PG16+ has its own any_value function. Attempting to do so results in the error seen in pg16-pg17 upgrade:

ERROR:  cannot drop function any_value(anyelement) because it is required by the database system
CONTEXT:  SQL statement "DROP AGGREGATE IF EXISTS pg_catalog.any_value(anyelement)"

When 16 becomes the minimum supported Postgres version, the drop statements can be removed.

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (naisila/pg17_support@1c2e784). Learn more about missing BASE report.

Additional details and impacted files
@@                   Coverage Diff                   @@
##             naisila/pg17_support    #7788   +/-   ##
=======================================================
  Coverage                        ?   89.62%           
=======================================================
  Files                           ?      274           
  Lines                           ?    59707           
  Branches                        ?     7448           
=======================================================
  Hits                            ?    53510           
  Misses                          ?     4065           
  Partials                        ?     2132           

Copy link
Member

@naisila naisila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, I remember I have implemented this so sorry for that mistake :)

However we can't merge as it is as we need to create a new .sql file for the new citus version. We don't modify old .sql files. I don't remember where the ocumentation for this part is, but basically we need to add a new 13.0-1.sql file with the modified script, and also an upgrade and downgrade path for Citus https://github.com/citusdata/citus/tree/release-13.0/src/backend/distributed/sql

In citus_prepapre_upgrade(), don't drop any_value when upgrading from
PG16+, because PG16+ has its own any_value function. Attempting to do
so results in an error. When 16 becomes the minimum supported Postgres
version, the drop statements can be removed.
@colm-mchugh colm-mchugh force-pushed the cmchugh/pg17-16-17-upgrade branch from 84710e9 to b0d624f Compare December 18, 2024 16:28
@colm-mchugh
Copy link
Contributor Author

However we can't merge as it is as we need to create a new .sql file for the new citus version. We don't modify old .sql files. I don't remember where the ocumentation for this part is, but basically we need to add a new 13.0-1.sql file with the modified script, and also an upgrade and downgrade path for Citus https://github.com/citusdata/citus/tree/release-13.0/src/backend/distributed/sql

The latest push reverts the modification to the existing citus sql file and adds a new one; however it probably needs #7792 to enable the pg16 -> pg17 upgrade to pass (?)

@naisila naisila force-pushed the naisila/pg17_support branch 5 times, most recently from c8c79ec to 3f72611 Compare December 20, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants