liveBook · Manning

Search path

A search path is an ordered list of database schemas searched to resolve unqualified object names.

How 2 Manning books explain it

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.

Read how Just Use Postgres! explains search path →

Related concepts

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.