Navigation Menu

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

current_schema not in sys.keywords #7093

Closed
yzchang opened this issue Mar 30, 2021 · 0 comments
Closed

current_schema not in sys.keywords #7093

yzchang opened this issue Mar 30, 2021 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@yzchang
Copy link
Member

yzchang commented Mar 30, 2021

While looking for available global variables, I noticed current_schema is not in sys.keywords (Oct2020 5e7ef9c3f0bd):

sql>select distinct * from sys.keywords where keyword ilike '%current%';
+-------------------+
| keyword           |
+===================+
| CURRENT           |
| CURRENT_DATE      |
| CURRENT_ROLE      |
| CURRENT_TIME      |
| CURRENT_TIMESTAMP |
| CURRENT_USER      |
+-------------------+

Why is current_schema not a reserved keyword? While it seems to behave like one:

sql>create table t (current_schema string);
#2021-03-30 14:44:16: client1: createExceptionInternal: !ERROR: ParseException:SQLparser:42000!syntax error, unexpected CURRENT_SCHEMA, expecting FOREIGN or PRIMARY or UNIQUE in: "create table t (current_schema"
syntax error, unexpected CURRENT_SCHEMA, expecting FOREIGN or PRIMARY or UNIQUE in: "create table t (current_schema"
sql>create table t ("current_schema" string);
operation successful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants