Search path
A search path is an ordered list of database schemas searched to resolve unqualified object names.
PostgreSQL Mistakes and How to Avoid Them
A schema search path is an ordered list of database schemas that PostgreSQL searches to resolve unqualified object names.
- How it is used
- Protects unqualified object resolution from accidental shadowing and malicious query hijacking.
- How deep it goes
- Defines ordered schema lookup and traces shadowing through functions, tables, operators, and sequences before prescribing controls.
- Examples
- Uses customers, now(), current_month_sales(), SHOW search_path, REVOKE CREATE, and an ALTER FUNCTION setting.
- What you can do after
- Operate/configure it: restrict schema creation and set safe paths for privileged functions.
Read how PostgreSQL Mistakes and How to Avoid Them explains search path →
Just Use Postgres!
A PostgreSQL search path is an ordered list of schemas searched for unqualified database objects.
- How it is used
- Routes unqualified database commands to the selected schema in a multi-schema application database.
- How deep it goes
- Defines implicit schema resolution and demonstrates SHOW and SET, but does not discuss precedence or session persistence.
- Examples
- Uses products, customers, and sales schemas plus an unqualified catalog query.
- What you can do after
- Apply it via SQL to inspect and change schema resolution for unqualified queries.
Related concepts
- schemauses · A data schema is a formal specification of the structure, fields, types, relationships, and constraints of data.
- security definerconfigured by · SECURITY DEFINER is a PostgreSQL function execution mode that runs the function with the privileges of its owner rather than its caller.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

