Skip to content

fix(test): Adapt base type creation test for Cloudberry#30

Merged
gfphoenix78 merged 1 commit intoapache:sync-with-upstreamfrom
robertmu:base-type
Aug 28, 2025
Merged

fix(test): Adapt base type creation test for Cloudberry#30
gfphoenix78 merged 1 commit intoapache:sync-with-upstreamfrom
robertmu:base-type

Conversation

@robertmu
Copy link
Copy Markdown
Contributor

This commit resolves an integration test failure for PrintCreateBaseTypeStatement when running against Cloudberry, which is based on PostgreSQL 14.

PostgreSQL 14 enforces stricter validation for CREATE TYPE. It now requires that a type specified with an ELEMENT parameter must also have an associated subscripting function. This requirement is not enforced in PostgreSQL 12 (on which GPDB 7 is based), which allowed ELEMENT as a metadata-only attribute.

To ensure compatibility, this change conditionally modifies the baseType struct in the BeforeEach block. When running on Cloudberry, the Element field is set to an empty string. This ensures that the auto-generated CREATE TYPE statement is valid for PostgreSQL 14, allowing the test to pass while preserving the original logic for GPDB 7.

This commit resolves an integration test failure for
PrintCreateBaseTypeStatement when running against Cloudberry, which is
based on PostgreSQL 14.

PostgreSQL 14 enforces stricter validation for `CREATE TYPE`. It now
requires that a type specified with an `ELEMENT` parameter must also
have an associated subscripting function. This requirement is not
enforced in PostgreSQL 12 (on which GPDB 7 is based), which allowed
`ELEMENT` as a metadata-only attribute.

To ensure compatibility, this change conditionally modifies the `baseType`
struct in the `BeforeEach` block. When running on Cloudberry, the
`Element` field is set to an empty string. This ensures that the
auto-generated `CREATE TYPE` statement is valid for PostgreSQL 14,
allowing the test to pass while preserving the original logic for GPDB 7.
@gfphoenix78 gfphoenix78 merged commit 93f7821 into apache:sync-with-upstream Aug 28, 2025
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