Skip to content
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: name resolution handles unpermissioned schemas differently from postgres #54587

Open
solongordon opened this issue Sep 18, 2020 · 1 comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-ux-surprise Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@solongordon
Copy link
Contributor

solongordon commented Sep 18, 2020

While testing out #54538 I noticed that we handle name resolution differently from Postgres when it comes to schemas the user doesn't have privileges on.

For instance, say my username is "solon" and the search path is the default $user,public. If the solon schema exists and I don't have any permissions on it, this is the result:

solon@:26257/defaultdb> create table t ();
ERROR: user solon does not have CREATE privilege on schema solon
SQLSTATE: 42501

Similarly if there is a table named t in both the solon and public schemas, this is the result:

solon@:26257/defaultdb> select * from t;
ERROR: user solon does not have USAGE privilege on schema solon
SQLSTATE: 42501

This is not the case with Postgres, which would fallback to the public schema in both cases.

More investigation is needed to understand exactly what the Postgres logic is here.

Jira issue: CRDB-3737

@solongordon solongordon added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-ux-surprise Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption. labels Sep 18, 2020
@rafiss rafiss added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label May 12, 2021
@github-actions
Copy link

github-actions bot commented Sep 6, 2023

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2023
@yuzefovich yuzefovich reopened this May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-ux-surprise Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests

3 participants