Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 680 Bytes

Readme.md

File metadata and controls

38 lines (27 loc) · 680 Bytes

Build Status

mvtbl

A postgres Extension to easily move tables around tablespaces

The function mvtbl(tablname, tablespace ) moves a table tablname along with all indexes to the tablespace tablespace and returns the moved data size in bytes.

Usage

see test/expected/mvtbl.out for examples

SELECT pg_size_pretty(mvtbl('test','mvtbl_test_tblspace'));
 pg_size_pretty 
----------------
 123 MB
(1 row)

SELECT pg_size_pretty(mvtbl('public.test','pg_default'));
 pg_size_pretty 
----------------
 123 MB
(1 row)

Installation

$ make install
CREATE EXTENSION mvtbl;