Skip to Content
PostgreSQL 10 Administration Cookbook - Fourth Edition
book

PostgreSQL 10 Administration Cookbook - Fourth Edition

by Simon Riggs, Gianni Ciolli
May 2018
Intermediate to advanced content levelIntermediate to advanced
576 pages
30h 25m
English
Packt Publishing
Content preview from PostgreSQL 10 Administration Cookbook - Fourth Edition

Putting pg_wal on a separate device

You may seek advice about placing the pg_wal  directory on a separate device for performance reasons. This sounds very similar to tablespaces, though there is no explicit command to do this once you have a running database, and files in pg_wal  are frequently written. So you must perform the steps outlined in the following example:

  1. Stop the database server:
[postgres@myhost ~]$ pg_ctl stop
  1. Move pg_wal  to a location supported by a different disk device:
[postgres@myhost ~]$ mv $PGDATA/pg_wal  /mnt/newdisk/
  1. Create a symbolic link from the old location to the new location:
[postgres@myhost ~]$ ln -s /mnt/newdisk/pg_wal    $PGDATA/pg_wal 
  1. Restart the database server:
[postgres@myhost ~]$ pg_ctl start
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PostgreSQL 13 Cookbook

PostgreSQL 13 Cookbook

Vallarapu Naga Avinash Kumar
PostgreSQL 9 Administration Cookbook - Second Edition

PostgreSQL 9 Administration Cookbook - Second Edition

Simon Riggs, GIANNI CIOLLI, Hannu Krosing, Gabriele Bartolini

Publisher Resources

ISBN: 9781788474924Supplemental Content