Loading Depth Study
Preparing your workspace
PostgreSQL schemas provide namespaces that help organize related database objects inside a database.
A PostgreSQL database can contain multiple schemas, and each schema can contain tables, views, functions, sequences, and other objects. The public schema is commonly used by default, but larger systems may create separate schemas for different domains or application areas. Schemas can improve organization and can also participate in permission design. Table names should be consistent, meaningful, and aligned with the application's domain.
A larger platform might separate application tables, analytics tables, or internal operational objects into different schemas.
CREATE SCHEMA learning; CREATE TABLE learning.courses ( id UUID PRIMARY KEY, title TEXT NOT NULL ); SELECT * FROM learning.courses;
A learning schema is created and the courses table is stored inside that schema.