Skip to content

sql: deprecate cross-database references between catalog elements #55791

@thoszhang

Description

@thoszhang

As part of moving toward a more Postgres-compatible world where databases are isolated from each other, we're going to stop supporting references between catalog elements (i.e., tables, types, and schemas) in different databases. The following kinds of references will only be permitted for tables/types in the same database:

In 20.2 we introduced cluster settings to disallow creating new cross-database references for foreign keys, sequence owners, and views by default (#54126).

The proposal is that in 21.1 we'll always disallow the creation of new cross-database references, and have a mechanism to prevent upgrading to 21.2 until users have removed all their existing cross-database references by either moving tables or removing the cross-database schema elements. Specifically, we'd use the long-running migration framework, and have a potentially very long running migration that continually checks whether users have finished removing their cross-database references, and only completes successfully upon confirming that they have.

Other concerns:

Epic: CRDB-1519

Jira issue: CRDB-3631

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions