Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the diference between pg_global and pg_default on postgresql?

Tags:

postgresql

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?

like image 534
thclpr Avatar asked Mar 14 '13 09:03

thclpr


People also ask

How do I find the temp tablespace in PostgreSQL?

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.

What is the max size of a table in PostgreSQL?

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.

What is Pgdata in Postgres?

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 .

What is base folder in PostgreSQL?

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.


1 Answers

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).

like image 69
d1ll1nger Avatar answered Nov 03 '22 17:11

d1ll1nger