current_schema()

A function returning the name of the current schema

current_schema() is a system function returning the name of the current schema.

current_schema() was added in PostgreSQL 7.3.

Usage

current_schema() → name

current_schema is provided as an SQL-standard equivalent.

Change history

Examples

Execution of current_schema():

postgres=# SELECT current_schema();
 current_schema
----------------
 public
(1 row)

postgres=# SET search_path TO pg_catalog;
SET

postgres=# SELECT current_schema();
 current_schema
----------------
 pg_catalog
(1 row)

Categories

Schema (namespace), System function

See also

current_schema, current_schemas()