- Schemas can be easily created using the following commands:
CREATE SCHEMA finance; CREATE SCHEMA sales;
- We can then create objects directly within those schemas using fully qualified names, like this:
CREATE TABLE finance.month_end_snapshot (.....)
The default schema in which an object is created is known as the current_schema. We can find out which is our current schema using the following query:
postgres=# select current_schema;
This returns an output like the following:
current_schema---------------- public(1 row)
- When we access database objects, we use the user-settable search_path parameter to identify the schemas to search for. The current_schema is the first schema in the search_path parameter. There is no separate ...