-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: fix qualified index name resolution
In CockroachDB index names are relative to a table name (e.g. `tbl@idx`) but in Postgres index names live in the schema namespace. To offer compatibility with Postgres, CockroachDB implements a special name resolution algorithm for index names specified without the '@' syntax. For example, `DROP INDEX foo` will search all tables in the current schema to find one with index name `foo`. Prior to this patch, CockroachDB was not able to search for a _qualified_ index name specified without the '@' syntax. For example, TypeORM issues `DROP INDEX public."primary"`, expecting to be able to drop the primary index of some table in the `public` schema. This was not recognized by CockroachDB. This patch extends the name resolution for index names to support both partial and complete qualification, using the same name resolution rules as other objects. Release note (sql change): CockroachDB now supports more ways to specify an index name for statements that require one (e.g., `DROP INDEX`, `ALTER INDEX ... RENAME`, etc.), in a way more compatible with PostgreSQL.
- Loading branch information
Showing
3 changed files
with
77 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters