IS VIEW EXISTS

The IS VIEW EXISTS check whether a view exists in a specified schema within the database.

Syntax

SELECT is_view_exists(<'schema_name'>, <'view_name'>)

Arguments

Parameter

Description

schema_name

The schema to search for the view within

table_name

The name of the view to check for existence

Returns

  • 1 if view exists

  • 0 if view does not exist

Example

SELECT is_view_exists('public', 'my_view');

-----
1