-
Notifications
You must be signed in to change notification settings - Fork 477
Allow DB owner to set session var defaults in DB #20858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Allow DB owner to set session var defaults in DB #20858
Conversation
✅ Deploy Preview for cockroachdb-api-docs canceled.
|
✅ Deploy Preview for cockroachdb-interactivetutorials-docs canceled.
|
|
@rafiss this is to document the changes from cockroachdb/cockroach#130547 |
✅ Netlify Preview
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
||
| ### `RESET {session variable}` | ||
|
|
||
| `ALTER DATABASE ... RESET {session variable}` resets a [session variable]({% link {{ page.version.version }}/set-vars.md %}#supported-variables) for a database to its default value for the client session. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not part of your PR, but this is not accurate. It should say something more like:
ALTER DATABASE ... RESET {session variable}removes the override for a default value of a [session variable]({% link {{ page.version.version }}/set-vars.md %}#supported-variables) for a database for future sessions.
(My suggestion is too much word salad... but hopefully my intent is legible. Basically, my point is that this only affects future sessions.)
For reference, postgres docs:
The remaining forms change the session default for a run-time configuration variable for a PostgreSQL database. Whenever a new session is subsequently started in that database, the specified value becomes the session default value.
| No [privileges]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) are required to reset a session setting. | ||
| To reset default session variable values for a database with `ALTER DATABASE ... RESET {session variable}`, the user must be a member of the [`admin` role]({% link {{ page.version.version }}/security-reference/authorization.md %}#admin-role) or the [owner]({% link {{ page.version.version }}/security-reference/authorization.md %}#object-ownership) of the target database. | ||
|
|
||
| All other session variables do not require [privileges]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) to modify. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "other session variables" referring to here? I think we possibly could just remove this sentence entirely.
Fixes DOC-14457