CREATE SCHEMA

An SQL command for defining a new schema

CREATE SCHEMA is a DDL command for defining a new schema.

CREATE SCHEMA was added in PostgreSQL 7.3.

Change history

Examples

Basic usage example for CREATE SCHEMA:

postgres=# CREATE SCHEMA foo;
CREATE SCHEMA

postgres=# \dn
      List of schemas
  Name  |       Owner
--------+-------------------
 foo    | postgres
 public | pg_database_owner
(2 rows)

Categories

DDL, Schema (namespace), SQL command

See also

ALTER SCHEMA, DROP SCHEMA, pg_namespace