-
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: make NOTHING and INDEX non-reserved keywords #89903
Conversation
90a7b72
to
7b72594
Compare
NB: I've looked at FAMILY too but that will require a different approach. I might think about it more, perhaps in a different PR, unless you have a different idea. |
7a51ed7
to
7fde330
Compare
(recusing myself as i'm no longer actively involved in the experience team) |
@otan i just wanted to involve you because that might simplify some migration stuff? How are identifiers from the source database handled if they are CRDB keywords? |
when translating (at least from other languages), we rewrite the foreign language AST with the with PG we're not great at handling name differences atm, so this would help that! |
Is this also done for the SQL queries that operate on the tables afterwards? |
we don't rewrite any queries atm but if we need to we could. |
yeah ok then that's one more reason to ensure that non-quoted identifiers in pg remain non-quoted in crdb. |
Release note (bug fix): It is now possible again to create tables, views, columns, etc with the name `nothing` (e.g. `CREATE TABLE nothing...`) without having to quote the name, like in PostgreSQL. This bug was introduced in CockroachDB v2.0.
Release note (bug fix): It is now possible again to create tables, views, columns, etc with the name `index` (e.g. `CREATE TABLE index...`) without having to quote the name, like in PostgreSQL. This bug was introduced in CockroachDB v1.0.
7fde330
to
d7e34e6
Compare
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.
nice, thanks for the comprehensive test cases as well!
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis and @knz)
docs/generated/sql/bnf/stmt_block.bnf
line 2621 at r2 (raw file):
'INDEX' | 'INDEX' | 'INDEX'
should we fix something so there's no dupe in this generated doc?
the diagram generator already de-dups. Do we print the raw BNF in text form anywhere? |
i don't think so |
cheers bors r=rafiss |
Build succeeded: |
Fixes #69420.
Release note (bug fix): It is now possible again to create tables,
views, columns, etc with the name
nothing
(e.g.CREATE TABLE nothing...
) without having to quote the name, like inPostgreSQL. This bug was introduced in CockroachDB v2.0.
Release note (bug fix): It is now possible again to create tables,
views, columns, etc with the name
index
(e.g.CREATE TABLE index...
) without having to quote the name, like inPostgreSQL. This bug was introduced in CockroachDB v1.0.