Making sense of search_path
In Chapter 12, I showed you how to expose additional schemas to the API. At supabase.com, alongside the Exposed schemas configuration, you’ll also find an Extra search path configuration:
Figure 13.1: Extra search path (supabase.com)
The same configuration is found for your local instance in the config.toml
file in the [api]
section as follows:
extra_search_path = ["public", "extensions"]
For many, this opens the question, “What does this do and what is it good for?” To answer this question, I first want to discover what the search path does in Postgres and then explain the impact of this configuration.
Comprehending search path in Postgres
The search path is not Supabase-specific. It’s a Postgres setting that is set for each Postgres database role and defines which schemas the database should look at to find data structures such as tables, functions, and views when...