What you're seeing is mostly one user interface's way of displaying the structure of a PostgreSQL database.

If you were using pgAdminIII, which is just another administrative interface, each database would usually show two "catalogs": information_schema and pg_catalog. It would also have a schema named "public".

Database objects named "pg_*" are system objects. The pg_toast schema holds TOAST storage for large tables.

The information_schema views are part of the SQL standard. They're supposed to provide a vendor-independent way to determining information that's stored in vendor-specific system tables.

You can make a good case for not exposing every namespace as if it were a user-level schema. (Internally, these are namespaces. Try select * from pg_namespace;.) The only schema in a newly created database that really matters to users is "public".

Answer from Mike Sherrill 'Cat Recall' on Stack Exchange
🌐
Wordpress
asusualcoding.wordpress.com › 2024 › 04 › 25 › how-to-set-default-schema-in-postgres
How to set default schema in Postgres? – My coding exploration
April 25, 2024 - Basically we can set the default schema using SearchPath in the connection strings. We can define connection string in different formats. There are few as below. Host=<host_name>;Port=<port_no>;Database=<database_name>;User ID=<user_name>;P...
🌐
PostgreSQL
postgresql.org › docs › current › ddl-schemas.html
PostgreSQL: Documentation: 18: 5.10. Schemas
May 14, 2026 - Keep the default search path, and grant privileges to create in the public schema. All users access the public schema implicitly. This simulates the situation where schemas are not available at all, giving a smooth transition from the ...
Top answer
1 of 2
12

What you're seeing is mostly one user interface's way of displaying the structure of a PostgreSQL database.

If you were using pgAdminIII, which is just another administrative interface, each database would usually show two "catalogs": information_schema and pg_catalog. It would also have a schema named "public".

Database objects named "pg_*" are system objects. The pg_toast schema holds TOAST storage for large tables.

The information_schema views are part of the SQL standard. They're supposed to provide a vendor-independent way to determining information that's stored in vendor-specific system tables.

You can make a good case for not exposing every namespace as if it were a user-level schema. (Internally, these are namespaces. Try select * from pg_namespace;.) The only schema in a newly created database that really matters to users is "public".

2 of 2
8

If you keep the default search_path and use the default schema public (automatically), you don't have to bother with schemas at all.

But if your database grows, chances are you will happily make use of them to organize objects and privileges. By setting the search_path per user / database / session / ... you can manage schemas precedence any way you want. I have assembled a couple of ways to do this in this related answer on SO.

Schemas are much like directories in the file system:
If you don't schema-qualify an object name (myschema.mytable), the first schema in your search_path is assumed when creating objects. That's like the "current directory" in the file system.

All schemas in the search_path are searched in sequence when using objects. Just like with a search path in the file system.

But:
There is no "root schema", and no nesting. You can't store anything "without schema". Every object is created inside a particular schema. (Except special objects on the database-cluster level, like roles and databases.)

The current role needs privileges to access a schema. Schemas are extremely useful if you want to organize things and still be able to access other "areas" in a simple query.

MySQL does not have anything similar. You would use a separate database for many things solved with a separate schema in PostgreSQL.

🌐
CommandPrompt Inc.
commandprompt.com › education › how-do-i-setchange-the-default-schema-in-postgresql
How Do I Set/Change the Default Schema in PostgreSQL — CommandPrompt Inc.
March 2, 2023 - A schema in database management systems represents a set of rules that regulate/handle a database. It is a logical structure that holds various database objects like views, tables, indexes, sequences, etc. In Postgres, “public” is a Default ...
Address   2950 Newmarket ST STE 101 - 231, 98226, Bellingham
🌐
Hasura
hasura.io › learn › database › postgresql › core-concepts › 1-postgresql-schema
PostgreSQL Schema | PostgreSQL Tutorial
... Fundamentally, schemas let ... with role based access, it's easier to restrict access to schemas. By default, the public schema is used in PostgreSQL when you set it up for the first time....
🌐
Medium
medium.com › @jramcloud1 › understanding-the-public-schema-and-search-path-in-postgresql-a-practical-guide-b8b550fab9cc
Understanding the Public Schema and Search Path in PostgreSQL: A Practical Guide | by Jeyaram Ayyalusamy | Medium
June 10, 2025 - This is particularly useful when you have a large application with multiple components, teams, or modules accessing the same database. Every new PostgreSQL database comes with a default schema named public.
Find elsewhere
🌐
Dba-ninja
dba-ninja.com › 2022 › 05 › how-to-change-postgresql-default-schema.html
How to change PostgreSQL default schema
May 17, 2022 - You can change the default schema with this command - but the problem is this will be just for the current session ... 3) Change the postgresql.conf under the CLIENT CONNECTION DEFAULTS section Author: Rambler (http://www.dba-ninja.com)
🌐
PostGIS
postgis.net › workshops › postgis-intro › schemas.html
37. PostgreSQL Schemas — Introduction to PostGIS
Fortunately, PostgreSQL includes the concept of a “_Schema”. Schemas are like folders, and can hold tables, views, functions, sequences and other relations. Every database starts out with one schema, the public schema. Inside that schema, the default install of PostGIS creates the ...
🌐
DB Vis
dbvis.com › thetable › schemas-in-postgresql
Schemas in PostgreSQL: Best Practices of PostgreSQL Schemas
March 11, 2024 - PostgreSQL creates the public schema by default, but you can create additional custom schemas to suit your needs.
🌐
Mkyong
mkyong.com › home › postgresql › postgresql – how to change default schema
PostgreSQL - How to change default schema - Mkyong.com
August 18, 2008 - However above command is apply to current session only, next time schema will change back to public. If we want to make effect permanently, we have to change in postgresql.conf file like following. #--------------------------------------------------------------------------- # CLIENT CONNECTION DEFAULTS #--------------------------------------------------------------------------- # - Statement Behavior - #search_path = '"$user",public' # schema names search_path = '"$user",new_schema' # NEW SCHEMA HERE #default_tablespace = '' # a tablespace name, '' uses # the default #check_function_bodies = on #default_transaction_isolation = 'read committed' #default_transaction_read_only = off
🌐
Baeldung
baeldung.com › home › persistence › connecting to a specific schema in jdbc
Connecting to a Specific Schema in JDBC | Baeldung
July 24, 2025 - Schema is a logical namespace that contains database objects such as tables, views, indexes, etc. Each schema belongs to one database, and each database has at least one schema. If not specified otherwise, the default schema in PostgreSQL is public.
🌐
Hackzine
wiki.hackzine.org › sysadmin › postgresql-change-default-schema.html
PostgreSQL: Change default schema — Hackzine Wiki
-- Use this to show the current search_path -- Should return: "$user",public SHOW search_path; -- Create another schema CREATE SCHEMA my_schema; GRANT ALL ON SCHEMA my_schema TO my_user; -- To change search_path on a connection-level SET search_path TO my_schema; -- To change search_path on a database-level ALTER database "my_database" SET search_path TO my_schema; comments powered by Disqus · Postfix: send-only configuration · PostgreSQL: Make root log in as postgres user ·
🌐
Severalnines
severalnines.com › home › posts pages › postgresql schema management basics
PostgreSQL Schema Management Basics | Severalnines
May 4, 2022 - Postgresql schemas serve this same purpose of organizing and identifying, however, unlike the second example above, Postgresql schemas cannot be nested in a hierarchy. While a database may contain many schemas, there is only ever one level and so within a database, schema names must be unique. Also, every database must include at least one schema. Whenever a new database is instantiated, a default schema named “public” is created.
🌐
Red Gate Software
red-gate.com › home › postgresql schema: learning postgresql with grant
PostgreSQL Schema: Learning PostgreSQL with Grant | Simple Talk
April 16, 2024 - Keeping object names distinct is a good practice, but sometimes the same name is the best name in different schemas): This is perfectly valid. If I were to write, what I consider poor code, like this: ... Initially, is seems like it’s an error because PostgreSQL can’t figure out which of the two testtable tables to pull from. Rather, it’s because logins have a default schema.
🌐
Reddit
reddit.com › r/postgresql › setting default schema in pgadmin4?
r/PostgreSQL on Reddit: Setting default schema in pgAdmin4?
June 4, 2021 -

I have tried to create table in pgAdmin4 in a certain designated schema.

However I always come across the following error

ERROR:  no schema has been selected to create in
LINE 4: CREATE TABLE concept (
                     ^

which is very annoying.

Can I set a default schema where I do not have to alter all the SQL commands?

I am copy-pasta-ing a bunch of SQL to set up a database, I just do no want to change stuff so often.

I tried

set search_path='eat_my_default_schema';

it just does not work well

Thanks!

🌐
Faun
faun.pub › schema-in-postgresql-94c2e13c2425
Schema in PostgreSQL - FAUN.dev()
July 2, 2021 - Schema is defined as a namespace ... To access an object from a schema use schema_name.object · In PostgreSQL, by default, every database owns a default Schema named public....
🌐
GitHub
github.com › jbranchaud › til › blob › master › postgres › default-schema.md
til/postgres/default-schema.md at master · jbranchaud/til
From our first select statement, we see that there is no schema with my user name, so postgres uses public as the default schema.
Author   jbranchaud
🌐
codestudy
codestudy.net › blog › how-to-select-a-schema-in-postgres-when-using-psql
How to Change Default Schema in PostgreSQL When Using psql: Command Line Guide — codestudy.net
In PostgreSQL, schemas act as namespaces for database objects (tables, views, functions, etc.), allowing you to organize and isolate data logically. By default, PostgreSQL uses the public schema for all objects if no schema is specified.