Skip to content

sql: Support user/role-level defaults for session variables #21151

@bdarnell

Description

@bdarnell

In postgres, any session variable can be set at the user/role level so it will be set automatically when that user connects. For example, this could be used to set a user-scope default time zone without changing the global default from UTC or dealing with the raciness of cluster settings.

ALTER USER foo SET timezone='America/New_York';

This is especially useful because postgres drivers don't typically have the facility to automatically issue a SET TIME ZONE command at the start of each session (a feature which is commonly found in mysql drivers, for example).

Epic CRDB-2507

Metadata

Metadata

Assignees

Labels

A-securityA-sql-pgcompatSemantic compatibility with PostgreSQLC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions