backupccl: allow table renames during restore #96830
Labels
A-disaster-recovery
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-disaster-recovery
It is a requirement that, when restoring tables into a database, tables (and views) of those names must not exist in the target database. Besides being inconvenient, it can lead users down a surprisingly frustrating road.
Users would like to do these table restores “in place”, next to the existing tables. We should enable this by allowing renaming the incoming tables at restore time.
Possible syntax using a new
AS
clause:After completion, users will end up with two tables. They then have the normal SQL primitives they need to merge (UPSERT etc).
While we are in the neighborhood, should we offer
AS
for restoring databases as well? This would be semantically equivalent toWITH new_db_name
.@dt Also mentions the idea of a “swap” option -- the existing identically-named table stays online during restore, which may take a while. Upon restore completion, the newly-restored table replaces the previous table, presumably atomically.
See also #55791
See also this Docs issue (internal) to be more prescriptive on when one should restore a table vs a database.
Jira issue: CRDB-24353
The text was updated successfully, but these errors were encountered: