You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ydb/docs/en/core/reference/ydb-cli/export-import/view-backup.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# View Backup and Restoration
1
+
# View backup and restoration
2
2
3
3
This article explains the backup and restoration behavior of views in {{ ydb-short-name }}.
4
4
5
-
## Backup File Organization (View vs Table)
5
+
## Backup file organization
6
6
7
7
In most aspects, backing up views does not differ from backing up tables:
8
8
@@ -18,9 +18,9 @@ However, the formats used to backup views and tables differ:
18
18
19
19
Thus, during restoration, tables are restored from the protobuf representation (`scheme.pb`), whereas views are restored by executing the `create_view.sql` statements.
20
20
21
-
## View Query Rewrite
21
+
## View query rewrite
22
22
23
-
As we have discussed in the previous [paragraph](#backup-file-organization-view-vs-table), {{ ydb-short-name }} views are backed up as `CREATE VIEW` SQL definitions. During restoration from a backup, these plain-text definitions require special processing to adjust object reference paths within view queries to ensure correctness in the target database.
23
+
As we have discussed in the previous [paragraph](#backup-file-organization), {{ ydb-short-name }} views are backed up as `CREATE VIEW` SQL definitions. During restoration from a backup, these plain-text definitions require special processing to adjust object reference paths within view queries to ensure correctness in the target database.
the {{ ydb-short-name }} CLI automatically rewrites the query stored in the `create_view.sql` file to reference `/target_db/my_table` instead of the original `/my_database/my_table`.
This ensures that after restoration, the references within the view correctly point to the intended tables or objects in the new environment.
71
71
72
-
#### Handling Relative Paths
72
+
#### Handling relative paths
73
73
74
74
Views can reference tables or other views using path-based references, which may be absolute or relative. Absolute reference paths are handled by replacing the `backup_root` path part with the `restore_root`. Relative reference paths follow similar logic. More precisely, relative paths are first resolved to absolute paths using the [TablePathPrefix](../../../yql/reference/syntax/pragma#table-path-prefix) pragma:
0 commit comments