I know this is a very basic question, but i could not find a answer around google.
But what is the main difference between those two tablespaces?
SELECT current_setting('temp_tablespaces'); Copy As explained later on in this recipe, if the setting is empty, it means that PostgreSQL is not using temporary tablespaces, and temporary objects will be located in the default tablespace for each database.
PostgreSQL normally stores its table data in chunks of 8KB. The number of these blocks is limited to a 32-bit signed integer (just over two billion), giving a maximum table size of 16TB.
Traditionally, the configuration and data files used by a database cluster are stored together within the cluster's data directory, commonly referred to as PGDATA (after the name of the environment variable that can be used to define it). A common location for PGDATA is /var/lib/pgsql/data .
The base directory in PostgreSQL (data_dir/base) is the folder is where PostgreSQL stores all the data you have inserted in your databases. It contains all the sub-directories which are used by a database in your clusters.
From Documentation:
Two tablespaces are automatically created by initdb. The pg_global tablespace is used for shared system catalogs. The pg_default tablespace is the default tablespace of the template1 and template0 databases (and, therefore, will be the default tablespace for other databases as well, unless overridden by a TABLESPACE clause in CREATE DATABASE).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With