Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

default_* session settings

These settings are available in system.settings and are autogenerated from source.

default_format

Version history
VersionDefault valueComment
26.8New setting for the default format when the query has no FORMAT clause.

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

Type
SQLSecurityType
Default
DEFINER
Version history
VersionDefault valueComment
24.2DEFINERAllows to set a default value for SQL SECURITY option when creating a materialized view

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

Type
UInt64
Default
1000000000

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

default_normal_view_sql_security

Type
SQLSecurityType
Default
INVOKER
Version history
VersionDefault valueComment
24.2INVOKERAllows to set default `SQL SECURITY` option while creating a normal view

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

The default value is INVOKER.

default_table_engine

Type
DefaultTableEngine
Default
MergeTree
Version history
VersionDefault valueComment
24.3MergeTreeSet default table engine to MergeTree for better usability

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

Type
DefaultTableEngine
Default
Memory

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

Type
String
Default
CURRENT_USER
Version history
VersionDefault valueComment
24.2CURRENT_USERAllows to set default `DEFINER` option while creating a view

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

The default value is CURRENT_USER.

Navigation