ALTER TABLE SET TYPE
Converts a non-WAL table to WAL, or a WAL table to non-WAL.
Upgrading QuestDB?
Apply table conversions separately from the version upgrade.
If upgrading, match the following sequence:
- Convert/
ALTERtables - Restart
- Upgrade
- Restart
Syntax
ALTER TABLE tableName SET TYPE [BYPASS] WAL;
Description
The command schedules the conversion of the specified table to WAL or non-WAL type. The actual conversion takes place on the next restart of the server.
For a table that may hold
merge-append partitions, first set
cairo.o3.partition.merge.append.enabled=false, restart, and run
ALTER TABLE trades SQUASH PARTITIONS; only then issue
ALTER TABLE trades SET TYPE BYPASS WAL and restart again.
Skipping these steps is unsupported.
If the command issued more than once before the restart, the last command overrides all previous ones.
If the target type of the conversion is the same as the current type of the table, the conversion request is ignored.
Examples
To convert a non-WAL table to WAL:
ALTER TABLE weather SET TYPE WAL;
-- now restart instance
To convert a WAL table to non-WAL:
ALTER TABLE weather SET TYPE BYPASS WAL;
-- now restart instance