Skip to content

Conversation

@tianzhou
Copy link
Contributor

PostgreSQL 14's pg_get_viewdef() function produces different output compared to PostgreSQL 15+, causing systematic test failures in view definitions.

The key difference is in how column references are formatted:

  • PostgreSQL 14: Uses table-qualified column names Example: SELECT dept_emp.emp_no, max(dept_emp.from_date) ...
  • PostgreSQL 15+: Simplifies unambiguous column references Example: SELECT emp_no, max(from_date) ...

This behavior change in PostgreSQL's internal ruleutils.c code affects all views (regular and materialized) and makes it impossible to maintain version-consistent output. The difference appears when pg_get_viewdef() reconstructs view definitions from stored metadata.

Test failure example (TestDumpCommand_Employee):

  • Expected (PG 15+): SELECT emp_no, max(from_date) AS from_date ...
  • Actual (PG 14): SELECT dept_emp.emp_no, max(dept_emp.from_date) ...

This is a PostgreSQL behavior change, not a pgschema bug. Since pgschema relies on pg_get_viewdef() for view introspection, supporting PG 14 would require version-specific view normalization logic that would be complex and error-prone.

Changes:

  • Removed PG 14 from mapToEmbeddedPostgresVersion() and getPostgresVersion()
  • Removed PG 14 test job from GitHub Actions workflow
  • Updated all documentation to reflect minimum version PostgreSQL 15
  • Updated README.md, CLAUDE.md, docs/faq.mdx

Minimum supported version is now PostgreSQL 15.

🤖 Generated with Claude Code

PostgreSQL 14's pg_get_viewdef() function produces different output
compared to PostgreSQL 15+, causing systematic test failures in view
definitions.

The key difference is in how column references are formatted:
- PostgreSQL 14: Uses table-qualified column names
  Example: SELECT dept_emp.emp_no, max(dept_emp.from_date) ...
- PostgreSQL 15+: Simplifies unambiguous column references
  Example: SELECT emp_no, max(from_date) ...

This behavior change in PostgreSQL's internal ruleutils.c code affects
all views (regular and materialized) and makes it impossible to maintain
version-consistent output. The difference appears when pg_get_viewdef()
reconstructs view definitions from stored metadata.

Test failure example (TestDumpCommand_Employee):
- Expected (PG 15+): SELECT emp_no, max(from_date) AS from_date ...
- Actual (PG 14): SELECT dept_emp.emp_no, max(dept_emp.from_date) ...

This is a PostgreSQL behavior change, not a pgschema bug. Since pgschema
relies on pg_get_viewdef() for view introspection, supporting PG 14
would require version-specific view normalization logic that would be
complex and error-prone.

Changes:
- Removed PG 14 from mapToEmbeddedPostgresVersion() and getPostgresVersion()
- Removed PG 14 test job from GitHub Actions workflow
- Updated all documentation to reflect minimum version PostgreSQL 15
- Updated README.md, CLAUDE.md, docs/faq.mdx

Minimum supported version is now PostgreSQL 15.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings October 31, 2025 15:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes support for PostgreSQL version 14, narrowing the supported versions to 15, 16, and 17. The changes ensure consistency across code, tests, and user-facing documentation.

  • Removed PostgreSQL 14 version mappings from test utilities and embedded Postgres configuration
  • Updated error messages and comments to reflect the new supported version range (15-17)
  • Removed PostgreSQL 14 test jobs from CI/CD workflows
  • Updated documentation files (README, FAQ, CLAUDE.md) to reflect the new version support

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
testutil/postgres.go Removed case for PostgreSQL version 14 from the version detection switch statement
internal/postgres/embedded.go Removed version 14 mapping, updated comment and error message to reflect supported versions 15-17
docs/faq.mdx Updated supported versions list from "14, 15, 16, and 17" to "15, 16, and 17"
README.md Updated version range from "14 through 17" to "15 through 17"
CLAUDE.md Updated version references from "14-17" to "15-17" in two locations
.github/workflows/release.yml Removed PostgreSQL 14 test job from the release workflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tianzhou tianzhou merged commit cf092b1 into main Oct 31, 2025
8 checks passed
tianzhou added a commit that referenced this pull request Oct 31, 2025
@tianzhou tianzhou deleted the drop_14 branch November 23, 2025 14:51
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.

1 participant