Skip to content

Fix assertion if index is dropped during REFRESH CONCURRENTLY#1632

Open
reshke wants to merge 2 commits intoapache:mainfrom
reshke:cp_a45c950ae35e53de40_main
Open

Fix assertion if index is dropped during REFRESH CONCURRENTLY#1632
reshke wants to merge 2 commits intoapache:mainfrom
reshke:cp_a45c950ae35e53de40_main

Conversation

@reshke
Copy link
Copy Markdown
Contributor

@reshke reshke commented Mar 21, 2026

When assertions are disabled, the built SQL statement is invalid and you get a "syntax error". So this isn't a serious problem, but let's avoid the assertion failure.

Backpatch to all supported versions.

Reviewed-by: Noah Misch

======

In CBDB, we backport this change for future-proofing and in sight of d42418a and general backporting of all security-related changes.

Copy link
Copy Markdown
Contributor

@avamingli avamingli 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 cherry-pick.

@reshke reshke force-pushed the cp_a45c950ae35e53de40_main branch 2 times, most recently from fb20573 to f893f35 Compare March 23, 2026 12:03
@leborchuk
Copy link
Copy Markdown
Contributor

matview tests failed with

+ERROR:  function cannot execute on a QE slice because it issues a non-SELECT statement
+CONTEXT:  SQL statement "DROP INDEX IF EXISTS mvtest_drop_idx"
+PL/pgSQL function mvtest_drop_the_index() line 3 at EXECUTE

Copy link
Copy Markdown
Contributor

@my-ship-it my-ship-it left a comment

Choose a reason for hiding this comment

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

Overall the code changes are solid upstream backports. LGTM!

hlinnaka and others added 2 commits April 24, 2026 20:59
When assertions are disabled, the built SQL statement is invalid and
you get a "syntax error". So this isn't a serious problem, but let's
avoid the assertion failure.

Backpatch to all supported versions.

Reviewed-by: Noah Misch
@reshke reshke force-pushed the cp_a45c950ae35e53de40_main branch from f893f35 to eea4f51 Compare April 24, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants