SHOW CREATE VIEW

Function

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 creates the routine.

collation_connection is the value specified when lc_collate creates the database.

Syntax

SHOW CREATE VIEW view_name

Parameter Description

  • view_name

    View name.

Examples

--Create a view
openGauss=# create view tt19v as
openGauss-# select 'foo'::text = any(array['abc','def','foo']::text[]) c1,
openGauss-#        'foo'::text = any((select array['abc','def','foo']::text[])::text[]) c2;
CREATE VIEW
--Query a statement for creating a view.
openGauss=# 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)
Feedback
编组 3备份
    openGauss 2024-10-03 04:45:44
    cancel