Skip to content

Report unsupported ALTER CONSTRAINT explicitly - #8808

Open
ibrahim halatci (ihalatci) wants to merge 4 commits into
mainfrom
ihalatci-pg19-explicit-alter-table-errors
Open

ibrahim halatci (ihalatci) wants to merge 4 commits into
mainfrom
ihalatci-pg19-explicit-alter-table-errors

Conversation

@ihalatci

@ihalatci ibrahim halatci (ihalatci) commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

DESCRIPTION: Report unsupported ALTER CONSTRAINT explicitly on PostgreSQL 19 RC1

Draft follow-up to #8758, based on the PostgreSQL 19 RC1 alignment in #8929.

This PR is intentionally limited to ALTER TABLE ... ALTER CONSTRAINT:

  • return FEATURE_NOT_SUPPORTED for distributed, reference, and Citus-local tables;
  • explain that constraint property changes are not propagated to shards;
  • preserve native PostgreSQL behavior for ordinary local tables;
  • verify rejected changes leave the constraint enforcement state unchanged.

The earlier unrelated DETACH PARTITION error-code, message, and detail changes have been removed.

Validation:

  • PostgreSQL 17.10: make -C src/test/regress check-minimal EXTRA_TESTS='partitioning_issue_3970' passed.
  • PostgreSQL 18.4: make -C src/test/regress check-minimal EXTRA_TESTS='pg18' passed.
  • PostgreSQL 19 RC1: make -C src/test/regress check-minimal EXTRA_TESTS='pg18' passed.
  • make check-style passed with CI-pinned uncrustify 0.82.0 and citusdata/tools v0.8.33.
  • ci/normalize_expected.sh produced no further changes.
  • git diff --check passed.

@codecov

codecov Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.81%. Comparing base (c7634e3) to head (fc9abbd).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8808   +/-   ##
=======================================
  Coverage   88.81%   88.81%           
=======================================
  Files         290      290           
  Lines       65455    65455           
  Branches     8255     8255           
=======================================
+ Hits        58132    58135    +3     
+ Misses       4938     4936    -2     
+ Partials     2385     2384    -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ihalatci
ibrahim halatci (ihalatci) force-pushed the ihalatci-pg19-explicit-alter-table-errors branch from d874fa3 to eaacf5e Compare September 28, 2026 14:14
@ihalatci
ibrahim halatci (ihalatci) force-pushed the ihalatci-pg19-explicit-alter-table-errors branch from eaacf5e to 247d269 Compare October 16, 2026 08:40
@ihalatci
ibrahim halatci (ihalatci) changed the base branch from main to ihalatci-postgresql-19-rc1 October 16, 2026 08:40
Base automatically changed from ihalatci-postgresql-19-rc1 to main October 16, 2026 11:15
ibrahim halatci (ihalatci) added a commit that referenced this pull request Oct 16, 2026
DESCRIPTION: Update PostgreSQL 19 CI and regression coverage to RC1

Update build, nightly cassert, and pg_upgrade image pins to the
published PostgreSQL 19 RC1 release images from merged
citusdata/the-process#253 (image suffix `-va0a5582`). The stable image
publication succeeded for merge commit
`a0a5582b39e72cec476f7b6ba37a2cf97572b930` in [the-process
build-test-images
run](https://github.com/citusdata/the-process/actions/runs/38888435235).
Preserve the existing exclusion of PG19 from Citus upgrade coverage.

Add a distributed `ON CONFLICT` regression for PostgreSQL's fix to
inference when an index expression on a NOT NULL column simplifies to a
Var ([upstream
commit](postgres/postgres@f9ccc5e)).
No Citus source change was indicated: the regression fails on PostgreSQL
19 Beta 4 and passes on RC1.

## RC1 feature audit

The audited upstream range is `REL_19_BETA4`
(`b73d13c32c834a2c8e1c60cb92f79530376cedf1`) through `REL_19_RC1`
(`0b8bff042a997fe50fcd1c4c83b9ef1cc9ed8a89`): 132 commits and 300
changed paths, with no feature-revert commit.

The Citus umbrella features remain present in RC1:

- REPACK / REPACK CONCURRENTLY: #8756 / #8805 remain relevant.
- EXPLAIN IO: #8770 / #8807 remain relevant.
- Constraint enforceability: #8758 / #8808 remain relevant.
- JSON COPY: merged #8760 / #8765 remains compatible with RC1.
- Distributed REPACK CONCURRENTLY support: #8772 remains a design-only
exception without an implementation PR.

The approved dependent topology is:

- native stack `#8929 -> #8805 -> #8807`;
- #8808 as an independent sibling based directly on this branch after
removing unrelated DETACH changes.

Version-neutral #8759 and #8762 are no longer subissues of #8782.

PostgreSQL RC2 is scheduled for 2026-11-12 and GA for 2026-11-19. RC2
must be rechecked for the open upstream eager-aggregation and
CHECK-enforcement items before final PG19 feature completion.

## Validation

Local validation on PostgreSQL 19 RC1: `pg19` (7/7), `multi_upsert`
(7/7), `multi_insert_select_conflict` (7/7), `multi_copy` (15/15),
`multi_outer_join` (7/7), `multi_deparse_shard_query` (7/7),
`multi_deparse_function` (7/7), and `multi_join_order_additional`
(16/16, with base schedule and whole schedule line). `merge` also passed
on Beta 4 after installing the missing `postgres_fdw` test dependency.

The repartition planning/pruning/task-assignment debug task-ID output
differences reproduce on both Beta 4 and RC1; no expected output was
changed for them.

The prior Citus head `7259ac9c94e9a6595eac092b18afc47b69197d4a` passed
all automatic checks. This suffix-only update switches CI to the
successfully published stable RC1 images; checks for the current head
will run after this update.

---------

Co-authored-by: Ibrahim Halatci <ihalatci@microsoft.com>
Copilot-Session: f2aeb1f7-5872-4dc8-a288-2bdafcf80c04
Return FEATURE_NOT_SUPPORTED for ALTER CONSTRAINT on Citus tables while preserving PostgreSQL local-table behavior. Verify distributed, reference, and Citus-local constraints remain unchanged after rejection.

Refs #8758

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9dfbe758-43f3-43da-8223-b1bb3b1b896f
Normalize the new expected-output columns and exclude the executed switch label that gcov cannot attribute from patch coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9dfbe758-43f3-43da-8223-b1bb3b1b896f
Check AT_AlterConstraint before the switch so gcov attributes the exercised condition and error path instead of reporting an uncovered case label.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9dfbe758-43f3-43da-8223-b1bb3b1b896f
Keep unsupported ALTER TABLE handling in the existing default ereport and select the explicit ALTER CONSTRAINT message there, avoiding un-attributable control-only coverage lines.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9dfbe758-43f3-43da-8223-b1bb3b1b896f
@ihalatci
ibrahim halatci (ihalatci) force-pushed the ihalatci-pg19-explicit-alter-table-errors branch from d7020de to fc9abbd Compare October 16, 2026 11:49
@ihalatci
ibrahim halatci (ihalatci) marked this pull request as ready for review October 23, 2026 17:48
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.

2 participants