Skip to content

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

@robertmu

Description

@robertmu

The access method (USING clause) is missing from CREATE MATERIALIZED VIEW statements generated by cloudberry-backup on Cloudberry, GPDB 7+. This can cause the restore process for these specific materialized views to fail.

The reason for the failure is that certain WITH storage options are only valid for specific access methods. For instance, options like compresstype=zstd, compresslevel=1 are only valid for append-optimized tables. When the USING clause is missing from the backup metadata script, the database defaults to a different access method (like heap) during restore. This default method does not support those WITH options, causing the CREATE MATERIALIZED VIEW command to fail validation.

For example, a matview originally created with an append-optimized access method like this:

CREATE MATERIALIZED VIEW mv_01
  USING ao_row
  WITH (compresstype=zstd, compresslevel=1)
AS
  SELECT * FROM t_view
  DISTRIBUTED BY (id);

...will fail to restore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions