Mapping tablespaces

pg_basebackup can be called directly if you are using an identical filesystem layout on the target system. If this is not the case, pg_basebackup allows mapping the master's filesystem layout to the desired layout:

-T, --tablespace-mapping=OLDDIR=NEWDIR          relocate tablespace in OLDDIR to NEWDIR
If your system is small, it could be a good idea to keep everything in one tablespace.

This holds true if I/O is not the problem (maybe because you are only managing a few gigabytes of data).

Get Mastering PostgreSQL 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.