SHOW CREATE VIEW

功能描述

它返回可用于重新创建命名视图的确切字符串。

注意事项

character_set_client是client_encoding创建例程时系统变量的会话值。

collation_connection是lc_collate创建数据库时指定的值。

语法格式

  1. SHOW CREATE VIEW view_name

参数说明

  • view_name

    视图名。

示例

  1. --创建视图
  2. openGauss=# create view tt19v as
  3. openGauss-# select 'foo'::text = any(array['abc','def','foo']::text[]) c1,
  4. openGauss-# 'foo'::text = any((select array['abc','def','foo']::text[])::text[]) c2;
  5. CREATE VIEW
  6. --查询视图创建语句
  7. openGauss=# show create view tt19v;
  8. View | Create View
  9. | character_set_client | collation_connection
  10. -------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------
  11. tt19v | CREATE OR REPLACE VIEW public.tt19v AS
  12. +| UTF8 | en_US.UTF-8
  13. | SELECT ('foo'::text = ANY (ARRAY['abc'::text, 'def'::text, 'foo'::text])) AS c1, ('foo'::text = ANY ((SELECT ARRAY['abc'::text, 'def'::text, 'foo'::text] AS "array")::text[])) AS c2; | |
  14. (1 row)