sql: generate unique table IDs for virtual tables #32963
Labels
A-sql-vtables
Virtual tables - pg_catalog, information_schema etc
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
E-easy
Easy issue to tackle, requires little or no CockroachDB experience
good first issue
help wanted
Help is requested / needed by the one who filed the issue to fix it.
This is pursuant of #32442 towards #19472.
To attach comments to virtual tables they must have stable table IDs that can be used to populate
system.comments
.However meanwhile we do not want them to be attached to range IDs because they are virtual.
Proposal:
allocate IDs for vtables statically in the code. This ensures that IDs remain stable as the code evolves.
use negative IDs, and have the negative value become an indication that the table is virtual (IsVirtualDesc).
make
COMMENT ON
do the right thing for themmake
crdb_internal.tables
list them alongside the others so thatSHOW TABLES
can list the comments for them.The text was updated successfully, but these errors were encountered: