-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: support database-level session variable defaults #26947
Comments
This is slightly subtle for us to support because our "database" is a postgres "schema". In postgres, you're always connected to exactly one database and can't refer to any others, so it's unambiguous which settings should apply. In cockroach, the database you're connected to is just a default namespace, and it's fine to connect to one database (perhaps |
Ben in pg too you can make cross database requests.
This feature is also super well defined, the setting is loaded based on the db in the connection string. Check out the linked doc.
…--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
We have marked this issue as stale because it has been inactive for |
still current in 21.1 |
Hey I'm trying to use Medusa in a K8s environment. I already have cockroach installed and have medusa talking to cockroach. The problem I'm running into is:
So I'd like to set a session variable but medusa doesn't expose sessions variables (as far as I can tell) in the database_url or elsewhere. I was looking for how to set database wide or user wide sessions variables so I could set the variable outside of the app running. I guess my problem would be solved either way. Make that setting non experimental or allow database or user session variables. |
Drupal does the following:
ALTER DATABASE "drupal" SET bytea_output = 'escape';
which is mean to set a database-level default setting for session vars.
See https://www.postgresql.org/docs/10/static/sql-alterdatabase.html:
Also, as an addition to #21151, users can have database-level session variable defaults, with the
ALTER USER <username> IN DATABASE <database_name> SET ...
syntax. See https://www.postgresql.org/docs/current/sql-alteruser.htmlThe information is populated in pg_db_role_setting: https://www.postgresql.org/docs/current/catalog-pg-db-role-setting.html
Epic CRDB-2507
The text was updated successfully, but these errors were encountered: