Skip to content

Conversation

@robertmu
Copy link
Contributor

On Cloudberry, Greenplum 7+, materialized views must be created with a specific access method (e.g., 'heap', 'ao_row') and associated storage options in the 'WITH' clause (e.g., 'compresstype=zstd').

The prior implementation did not back up the 'USING' clause. During restore, the database would default to another access method (e.g., 'heap') which might not support the view's storage options. This incompatibility caused the 'CREATE MATERIALIZED VIEW' command to fail validation.

This commit corrects the failure by:

  • Updating the view query for Cloudberry, GPDB 7+ to fetch the access method.
  • Modifying DDL generation to include the 'USING' clause.
  • Updating integration tests to verify the fix.

Fixes #61

On Cloudberry, Greenplum 7+, materialized views must be created with
a specific access method (e.g., 'heap', 'ao_row') and associated storage
options in the 'WITH' clause (e.g., 'compresstype=zstd').

The prior implementation did not back up the 'USING' clause.
During restore, the database would default to another access method
(e.g., 'heap') which might not support the view's storage options.
This incompatibility caused the 'CREATE MATERIALIZED VIEW' command
to fail validation.

This commit corrects the failure by:
- Updating the view query for Cloudberry, GPDB 7+ to fetch the access method.
- Modifying DDL generation to include the 'USING' clause.
- Updating integration tests to verify the fix.

Fixes apache#61
@my-ship-it my-ship-it merged commit b60130e into apache:main Oct 20, 2025
1 check passed
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.

'USING' clause for Materialized Views is missing from CREATE statements generated by cloudberry-backup on Cloudberry, GPDB 7+

2 participants