Adds new empty column to existing table
Single column is added instantly and is not back-populated even if table contains data. Please refer our guide to the data types. Adding a new column does not lock the table for reading and also does not wait on any reads to finish.
While single column is added atomically, adding multiple columns is not an atomic operation. QuestDB will stop adding remaining columns on the list on the first failure. It is therefore possible to add some columns and not others.
The following example adds a new column called
comment that is of
STRING type to the table
ALTER TABLE ratings ADD COLUMN comment STRING
If you adding
symbol column you can also specify symbol related options, for example:
ALTER TABLE ratings ADD COLUMN comment SYMBOL NOCACHE INDEX
index keywords are optional