Skip to main content

Syntax

SHOW VIEWS [ FROM schema_name ] [ LIKE_expression ];

Parameters

Parameter or clauseDescription
schema_nameThe schema from which existing views will be listed. If not specified, views from all schemas in the current schema search_path will be listed.
LIKE_expressionFilters the output based on names by applying pattern matching. See details in LIKE pattern matching expressions.

Example

Say we create the table t3 in the public schema and a view v3.
CREATE TABLE IF NOT EXISTS t3 (
    v1 int,
    v2 int,
    v3 int)
WITH (appendonly = 'true');

CREATE VIEW v3 AS SELECT sum(v2) AS sum_v2 FROM t3;
Then we can use SHOW VIEWS to show the existing views.
SHOW VIEWS FROM public;
        Name
---------------------
public.v1
public.v2
(2 rows)
Starting from v2.7.0, the name column in the output includes the schema name as a prefix (e.g., public.view_name). This helps distinguish views with the same name in different schemas when querying across multiple schemas in the search path.