Available only in unstable builds.
INSERT inserts values into a table.
INSERT statements insert data into tables. You may want to
into a table when:
- Manually inserting rows into Materialize from a non-streaming data source.
- Testing Materialize’s features without setting up a data stream.
|table_name||The name of the target table.|
|col_value||The value to be inserted into the column. If a given column is nullable, a
Tables do not persist any data that is inserted. This means that restarting a Materialize instance will lose any data that was previously stored in a table.
INSERT currently only supports a
VALUES clause. You cannot use other clauses,
INSERT INTO ... SELECT or
INSERT INTO .. DEFAULT VALUES with
Inserting data into a table
To insert data into a table, execute an
INSERT statement where the
is followed by a list of tuples. Each tuple in the
VALUES clause must have a value
for each column in the table. If a column is nullable, a
NULL value may be provided.
CREATE TABLE t (a int, b text NOT NULL); INSERT INTO t VALUES (1, 'a'), (NULL, 'b'); SELECT * FROM t; a | b ---+--- | b 1 | a
In the above example, the second tuple provides a
NULL value for column
NULL values may not be inserted into column
b, which is not nullable.