PostgreSQL Tablespace managment
Tablesapce Basics What is a tablespace? It defines where the contents of the tables should be saved. Rules: We can't use a database unless we have tablespace. pg_default is the default tablespace for all the databases. We can define the non-default tablespace while creating a database or can alter the existing database/s by assigning a non-default tablespace. Users can define on which tablespace the objects should be stored when creating them. What are the different types of tablespaces present in the Postgres database? There are two different types of tablespace: Default: by default, two tablespaces will be created at the server level. pg_default and pg_global Non-default: User created manually. postgres=# select * from pg_tablespace; oid | spcname | spcowner | spcacl | spcoptions -------+------------+----------+--------+------------ 1663 | pg_default | 10 | | 1664 | pg_glob...