search-path
No schema has been selected to create in … error
no schema has been selected to create in You get this error when your search_path setting has no valid first entry. Either your search path is empty, or the first entry is invalid (after renaming or dropping an existing schema?) or the current role lacks the necessary privileges to use the schema. Postgres does not … Read more
How does the search_path influence identifier resolution and the “current schema”
What is the schema search path search_path? The manual: […] tables are often referred to by unqualified names, which consist of just the table name. The system determines which table is meant by following a search path, which is a list of schemas to look in. Bold emphasis mine. This explains identifier resolution. The “current … Read more
How to check if a table exists in a given schema
It depends on what you want to test exactly. Information schema? To find “whether the table exists” (no matter who’s asking), querying the information schema (information_schema.tables) is incorrect, strictly speaking, because (per documentation): Only those tables and views are shown that the current user has access to (by way of being the owner or having … Read more