Skip to content
ClickHouse Docs

default_* session settings

Autogenerated from ClickHouse system tables

These settings are available in system.settings and are autogenerated from the ClickHouse snapshot.

default_format

Specifies the format of the query result when the query has no FORMAT clause and no other format override is applied.

default_materialized_view_sql_security

Allows to set a default value for SQL SECURITY option when creating a materialized view. More about SQL security.

The default value is DEFINER.

default_max_bytes_in_join

Maximum size of right-side table if limit is required but max_bytes_in_join is not set.

default_normal_view_sql_security

Allows to set default SQL SECURITY option while creating a normal view. More about SQL security.

The default value is INVOKER.

default_table_engine

Default table engine to use when ENGINE is not set in a CREATE statement.

Possible values:

  • a string representing any valid table engine name

Cloud default value: SharedMergeTree.

Example

Query:

SET default_table_engine = 'Log';

SELECT name, value, changed FROM system.settings WHERE name = 'default_table_engine';

Result:

┌─name─────────────────┬─value─┬─changed─┐
│ default_table_engine │ Log   │       1 │
└──────────────────────┴───────┴─────────┘

In this example, any new table that does not specify an Engine will use the Log table engine:

Query:

CREATE TABLE my_table (
    x UInt32,
    y UInt32
);

SHOW CREATE TABLE my_table;

Result:

┌─statement────────────────────────────────────────────────────────────────┐
│ CREATE TABLE default.my_table
(
    `x` UInt32,
    `y` UInt32
)
ENGINE = Log
└──────────────────────────────────────────────────────────────────────────┘

default_temporary_table_engine

Same as default_table_engine but for temporary tables.

In this example, any new temporary table that does not specify an Engine will use the Log table engine:

Query:

SET default_temporary_table_engine = 'Log';

CREATE TEMPORARY TABLE my_table (
    x UInt32,
    y UInt32
);

SHOW CREATE TEMPORARY TABLE my_table;

Result:

┌─statement────────────────────────────────────────────────────────────────┐
│ CREATE TEMPORARY TABLE default.my_table
(
    `x` UInt32,
    `y` UInt32
)
ENGINE = Log
└──────────────────────────────────────────────────────────────────────────┘

default_view_definer

Allows to set default DEFINER option while creating a view. More about SQL security.

The default value is CURRENT_USER.