-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: Support user/role-level defaults for session variables #21151
Copy link
Copy link
Closed
Labels
A-securityA-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-securityA-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)