Cloud

current_schema

The current_schema() is a session information function that returns the name of the first existing schema.

Syntax

There are two available syntax versions of current_schema() function:

Version 1
SELECT current_schema();
Version 2
SELECT current_schema;

Returns NULL if none of the schemas from search_path exist

Examples

This example shows how to get the current schema name using this function:

SELECT current_schema();

Example output:

+------------------+
| current_schema   |
+------------------+
| public           |
+------------------+