DBA Hub

📋Steps in this guide1/1

Move database to new tablespace in postgres

Imported guide

postgresql configurationintermediate
by PostgreSQL
15 views
1

Overview

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
postgres=#
alter database prod_crm set tablespace crm_tblspc;
Before running this. make sure there are no active connections in the database.
You can kill the existing session using below query.

postgres#
select pg_terminate_backend(pid) from pg_stat_activity where datname='DB_NAME';

Comments (0)

Please to add comments

No comments yet. Be the first to comment!