RESTORE_FLEXTABLE_DEFAULT_KEYS_TABLE_AND_VIEW

恢复键表和视图。无论删除任一表,函数还会将键表与其关联的 Flex 表链接起来。该函数还会指示其恢复了一个对象还是同时恢复了两个对象。

这是元函数。您必须在顶级 SELECT 语句中调用元函数。

行为类型

易变

语法

RESTORE_FLEXTABLE_DEFAULT_KEYS_TABLE_AND_VIEW ('flex-table')

参数

flex-table
Flex 表的名称

示例

此示例显示如何使用现有的 Flex 表调用此函数,还原键表和视图:

=> SELECT RESTORE_FLEXTABLE_DEFAULT_KEYS_TABLE_AND_VIEW('darkdata');
                     RESTORE_FLEXTABLE_DEFAULT_KEYS_TABLE_AND_VIEW
----------------------------------------------------------------------------------
The keys table public.darkdata_keys was restored successfully.
The view public.darkdata_view was restored successfully.
(1 row)

此示例描述函数恢复了 darkdata_view,但不需要恢复 darkdata_keys

=> SELECT RESTORE_FLEXTABLE_DEFAULT_KEYS_TABLE_AND_VIEW('darkdata');
                    RESTORE_FLEXTABLE_DEFAULT_KEYS_TABLE_AND_VIEW
------------------------------------------------------------------------------------
 The keys table public.darkdata_keys already exists and is linked to darkdata.
 The view public.darkdata_view was restored successfully.
(1 row)

还原键表之后,其中没有任何内容。要填充 Flex 键,请调用 COMPUTE_FLEXTABLE_KEYS 函数。

=> SELECT * FROM darkdata_keys;
 key_name | frequency | data_type_guess
----------+-----------+-----------------
(0 rows)

另请参阅