DBA Hub

📋Steps in this guide1/1

find/change default tablespace

postgres=# show default_tablespace; default_tablespace --------------------

postgresql configurationintermediate
by PostgreSQL
12 views
1

find/change default tablespace

--To change the default tablespace at database level: Steps to change default tablespace at session level:

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
postgres=#
show default_tablespace;
default_tablespace
--------------------
(1 row)
<<<< If output is blank means default is
pg_default
tablespace>>>>>
postgres=#
alter system set default_tablespace=ts_postgres;
ALTER SYSTEM
postgres=#
select pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)
postgres=#
show default_tablespace;
default_tablespace
--------------------
ts_postgres
(1 row)
postgres=#
SELECT name, setting FROM pg_settings where name='default_tablespace';
name | setting
--------------------+-------------
default_tablespace | ts_postgres
(1 row)
postgres=#
set default_tablespace=ts_postgres;
SET

Comments (0)

Please to add comments

No comments yet. Be the first to comment!