-
Notifications
You must be signed in to change notification settings - Fork 546
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
Use search_path
instead of db name on pg connections
#13502
base: master
Are you sure you want to change the base?
Conversation
4c3e083
to
07a1eaf
Compare
This would probably need some additional changes in the documentation (also the clients specific one), but I would like to get feedback if we go ahead with this. |
07a1eaf
to
fef26be
Compare
@proddata |
No worries, I wanted to get feedback first if this is feasible, before spending more time on it. |
fef26be
to
6ef210b
Compare
Hi @proddata, thanks for the PR! We added it to 5.5 board as we should proceed with this change. We need to test that crash, crate-python work and all tests are passing and we don't break tools compatibility. |
This will improve compatibility with some tools, as the setting of a |
I agree, and I guess that tools for PG wouldn't expect the db name ( |
This should neither effect |
Hi. Do you think we would need to check the JavaScript node-postgres driver, and the Python asyncpg and psycopg drivers? |
For people that may have applications configured relying on the current behavior (used "database name" to point the application to tables on a certain schema) it would be useful to have the ability to set default session settings for a user as proposed in #12109 so that they can upgrade CrateDB without having to reconfigure the applications (the applications may not have settings available to set the default schema/search_path or they may be under the control of a different team or require a different change control process). |
What do you want to check? :)
I think it is a rather theoretical problem. Any tool, where one would expect PostgreSQL compatibility potentially currently breaks (e.g. DBeaver). Any custom tool could use a |
In PostgreSQL, |
6ef210b
to
9c467ec
Compare
Agreed. That is how this change would behave. If
and i.e. will have the same behaviour as
|
Summary of the changes / Why this improves CrateDB
search_path
, CrateDB now uses the providedsearch_path
session setting. This change is in line with PostgreSQL and improves tool compatibility. To set the search_path, one can now e.g. use the JDBC driver'scurrentSchema
property.doc
is the default schema in CrateDB, similar topublic
in PostgreSQL. On http-connections this gets automatically set in thesearch_path
. On pg-connections, if a database/catalog name is supplied, the database/catalog name is used instead. Some tools require this to be set to the correct and only database/catalog name in CrateDBcrate
. However this alters the search_path tocrate
as well. Tools expecting to be able to set the search path, by providing asearch_path
property on connection - as e.g. possible with PostgreSQL JDBC usingcurrentSchema
- will likely end up with a deviatingsearch_path
. This is e.g. problematic in tools like DBeaver.This is likely a left-over from the MySQL-comaptibility days
relates to ##13472
Checklist
CHANGES.txt
for user facing changessql_features
table for user facing changesCHANGES.txt
(E.g. AdminUI)