fix(publication): ensure PostgreSQL 13+ compatibility for multi-table publications#8888
fix(publication): ensure PostgreSQL 13+ compatibility for multi-table publications#8888gbartolini merged 3 commits intomainfrom
Conversation
|
❗ By default, the pull request is configured to backport to all release branches.
|
|
/test limit=local |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/18656354632 |
f63ada9 to
834348f
Compare
|
/test limit=local |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/18676589645 |
|
/test |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/18741963356 |
|
/test |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/18741991753 |
42a8889 to
df6a91b
Compare
|
/test |
|
@leonardoce, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/18947070276 |
… publications Fix SQL generation for publications with multiple tables to support PostgreSQL 13+. The previous implementation generated SQL that only worked on PostgreSQL 15+: CREATE PUBLICATION "pub" FOR TABLE "t1", TABLE "t2" While this syntax is valid in PostgreSQL 15+, it fails in PostgreSQL 13+ with a syntax error. The fix now generates backward-compatible SQL: CREATE PUBLICATION "pub" FOR TABLE "t1", "t2" The implementation groups consecutive tables under a single TABLE keyword and properly handles mixed scenarios with TABLES IN SCHEMA, ensuring full compatibility across all supported PostgreSQL versions (13+). Fixes #8588 Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
…table publications (#8888) The previous implementation generated SQL valid only in PostgreSQL 15+, for example: CREATE PUBLICATION "pub" FOR TABLE "t1", TABLE "t2"; This syntax causes a syntax error in PostgreSQL 13 and 14. The fix updates the SQL generation to produce backward-compatible statements such as: CREATE PUBLICATION "pub" FOR TABLE "t1", "t2"; The new implementation groups consecutive tables under a single `TABLE` keyword and correctly handles mixed cases involving `TABLES IN SCHEMA`, ensuring full compatibility across all supported PostgreSQL versions (13+). Fixes #8588. Signed-off-by: Armando Ruocco [[email protected]](mailto:[email protected]) Signed-off-by: Gabriele Bartolini [[email protected]](mailto:[email protected]) Co-authored-by: Gabriele Bartolini [[email protected]](mailto:[email protected]) (cherry picked from commit 514a43d)
…table publications (#8888) The previous implementation generated SQL valid only in PostgreSQL 15+, for example: CREATE PUBLICATION "pub" FOR TABLE "t1", TABLE "t2"; This syntax causes a syntax error in PostgreSQL 13 and 14. The fix updates the SQL generation to produce backward-compatible statements such as: CREATE PUBLICATION "pub" FOR TABLE "t1", "t2"; The new implementation groups consecutive tables under a single `TABLE` keyword and correctly handles mixed cases involving `TABLES IN SCHEMA`, ensuring full compatibility across all supported PostgreSQL versions (13+). Fixes #8588. Signed-off-by: Armando Ruocco [[email protected]](mailto:[email protected]) Signed-off-by: Gabriele Bartolini [[email protected]](mailto:[email protected]) Co-authored-by: Gabriele Bartolini [[email protected]](mailto:[email protected]) (cherry picked from commit 514a43d)
…table publications (#8888) The previous implementation generated SQL valid only in PostgreSQL 15+, for example: CREATE PUBLICATION "pub" FOR TABLE "t1", TABLE "t2"; This syntax causes a syntax error in PostgreSQL 13 and 14. The fix updates the SQL generation to produce backward-compatible statements such as: CREATE PUBLICATION "pub" FOR TABLE "t1", "t2"; The new implementation groups consecutive tables under a single `TABLE` keyword and correctly handles mixed cases involving `TABLES IN SCHEMA`, ensuring full compatibility across all supported PostgreSQL versions (13+). Fixes #8588. Signed-off-by: Armando Ruocco [[email protected]](mailto:[email protected]) Signed-off-by: Gabriele Bartolini [[email protected]](mailto:[email protected]) Co-authored-by: Gabriele Bartolini [[email protected]](mailto:[email protected]) (cherry picked from commit 514a43d)
The previous implementation generated SQL that only worked on PostgreSQL 15+:
CREATE PUBLICATION "pub" FOR TABLE "t1", TABLE "t2"
While this syntax is valid in PostgreSQL 15+, it fails in PostgreSQL 13+ with a syntax error. The fix now generates backward-compatible SQL:
CREATE PUBLICATION "pub" FOR TABLE "t1", "t2"
The implementation groups consecutive tables under a single TABLE keyword and properly handles mixed scenarios with TABLES IN SCHEMA, ensuring full compatibility across all supported PostgreSQL versions (13+).
Fixes #8588
Note for reviewers