Skip to content

CURRENT_SCHEMA

CREATE SCHEMA tech;
SET search_path TO tech;
SELECT CURRENT_SCHEMA;
current_schema
------------------
tech
(1 row)

In the example, a new schema named ‘tech’ is created. After that, the search path is set to ‘tech’, effectively making it the current schema. The CURRENT_SCHEMA function is then used to return the name of the current schema, which is ‘tech’.