ALTER MATERIALIZED VIEW RESUME WAL

Restarts WAL transactions on a materialized view after resolving errors that caused suspension.

Syntax

ALTER MATERIALIZED VIEW viewName RESUME WAL [ FROM TRANSACTION sequencerTxn ]

Parameters

ParameterDescription
viewNameName of the materialized view to resume
FROM TRANSACTIONOptional starting transaction number (defaults to failed transaction)

When to use

Use this command when a materialized view's WAL processing has been suspended due to an error. The view will be marked as suspended = true in the wal_tables() output.

Examples

Check WAL status

Use wal_tables() to identify suspended views:

List WAL status for all tables and views
wal_tables();
namesuspendedwriterTxnsequencerTxn
trades_1htrue35

The trades_1h view is suspended. The last successful commit was transaction 3.

Resume from failed transaction

Restart processing from the next transaction after the last successful one:

Resume WAL processing
ALTER MATERIALIZED VIEW trades_1h RESUME WAL;

This resumes from transaction 4 (the failed transaction).

Resume from specific transaction

Skip problematic transactions by specifying a starting point:

Resume from specific transaction
ALTER MATERIALIZED VIEW trades_1h RESUME WAL FROM TRANSACTION 5;

Behavior

AspectDescription
Default resume pointResumes from the transaction after writerTxn
Skipped transactionsWhen using FROM TRANSACTION, earlier transactions are skipped
Error resolutionFix the underlying issue before resuming, or skip past it

Permissions (Enterprise)

Resuming WAL on a materialized view requires the ALTER MATERIALIZED VIEW permission on the specific view:

Grant alter permission
GRANT ALTER MATERIALIZED VIEW ON trades_1h TO user1;

Errors

ErrorCause
materialized view does not existView with specified name doesn't exist
view is not suspendedWAL is already running normally
permission deniedMissing ALTER MATERIALIZED VIEW permission (Enterprise)

See also