Schema search order for unqualified names.
At a glance
| Property | Value |
|---|---|
| Parameter | search_path |
| Category | Client Defaults |
| Default | "$user", public |
| Value type | boolean / enum / numeric |
| Change scope | Per-session (SET) |
What it does
The ordered list of schemas searched when an object is referenced without a schema qualifier. The first schema is also where new objects are created.
How to apply a change
Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.
Inspect the current value and source with SHOW search_path; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'search_path';.
Tuning guidance
Set explicitly per role/app to avoid surprises and a security pitfall: a writable public early in the path lets others shadow functions. Schema-qualify in security-definer functions and consider removing public.