文档中心MogDBMogDB StackUqbar
v5.0

文档:v5.0

支持的版本:

其他版本:

SHOW CREATE VIEW

功能描述

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

注意事项

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

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

语法格式

SHOW CREATE VIEW view_name

参数说明

  • view_name

    视图名。

示例

--创建视图
MogDB=# create view tt19v as
MogDB-# select 'foo'::text = any(array['abc','def','foo']::text[]) c1,
MogDB-#        'foo'::text = any((select array['abc','def','foo']::text[])::text[]) c2;
CREATE VIEW
--查询视图创建语句
MogDB=# show create view tt19v;
 View  |                                                                                      Create View                                                            
                           | character_set_client | collation_connection 
-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------
 tt19v | CREATE OR REPLACE VIEW public.tt19v AS                                                                                                                      
                          +| UTF8                 | en_US.UTF-8
       | 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; |                      | 
(1 row)
Copyright © 2011-2024 www.enmotech.com All rights reserved.