Documentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
There are several ways to define a setting for a user in ClickHouse, depending on the use case and how long you want the setting to be configured. Let’s look at a few scenarios…Configure a setting for a single query
ASELECT query can contain a SETTINGS clause where you can define any number of settings. The settings are only applied for that particular query. For example:
Configure a setting for a session
You can define a setting for the lifetime of a client session using aSET clause. This is handy for ad-hoc testing or for when you want a setting to live for the lifetime of a few queries - but not longer.
Configure a setting for a particular user
UseALTER USER to define a setting just for one user. For example:
getSetting function:
Specifying the settings this way will overwrite the current settings of the user i.e if you had other settings applied to the user but did not specify them in the
ALTER USER statement, they will be lost.If you want to retain your settings use the ALTER USER ... MODIFY SETTING ... instead