IntermediateAdvanced PostgreSQL
Theory: What is a Schema?
The query
SQL
-- Q: What is a schema in PostgreSQL?
-- A: A schema is a namespace that contains named database objects
-- (tables, views, functions). Every database can have multiple schemas.
-- The default schema is called "public".
-- Unlike MySQL (where Database and Schema are synonymous), in PostgreSQL,
-- a Database contains Schemas, which contain Tables.Note
“Useful for multi-tenant applications (one schema per tenant).