Skip to main content
The statement can modify one of the session configuration variables. These can also be queried via .

Supported variables

The following session variables are exposed only for backwards compatibility with earlier CockroachDB releases and have no impact on how CockroachDB runs:

Considerations

Session variable precedence

When a starts, CockroachDB determines the initial value of each by evaluating the settings in the following order (items earlier in the list take precedence over later items):
  1. : A value supplied as a query parameter in the connection URL (for example, .../movr?sslmode=disable&timezone=UTC).
  2. : A value set by ALTER ROLE {role_name} IN DATABASE {db_name} SET {var}={value}.
  3. : A value set by ALTER ROLE {role_name} SET {var}={value}.
  4. : A value set by ALTER ROLE ALL IN DATABASE {db_name} SET {var}={value} or equivalently by ALTER DATABASE {db_name} SET {var}={value}.
  5. : A value set by ALTER ROLE ALL SET {var}={value}.
If a session variable is not modified using any of the preceding methods, the built-in system default value is used. Note that the is exempt from settings 3–5. The root user is only affected by values specified in the connection string. You can also set session variables for the duration of a single transaction by using .
Changes to defaults using the preceding methods only apply to future sessions. This is because session variable resolution happens at session start time. To change a default value in an existing open session, set the variable explicitly with .

See also