IS TABLE EXISTS
The IS TABLE EXISTS
check whether a table exists in a specified schema within the database.
Syntax
SELECT is_table_exists(<'schema_name'>, <'table_name'>)
Arguments
Parameter |
Description |
---|---|
|
The schema to search for the table within |
|
The name of the table to check for existence |
Returns
1
if table exists0
if table does not exist
Example
SELECT is_table_exists('public', 'my_table');
-----
1