HomeMogDBMogDB StackUqbar
v5.0

Documentation:v5.0

Supported Versions:

Other Versions:

SHOW CREATE VIEW

Function

It returns the exact string that can be used to recreate the named view.

Precautions

character_set_client is the session value of the system variable when client_encoding created the routine.

collation_connection is the value specified when lc_collate created the database.

Syntax

SHOW CREATE VIEW view_name

Parameter Description

  • view_name

    The view name.

Examples

-- Create a view
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
-- Query view creation statement.
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.