Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Delay materialized view refresh during pg_restore
pg_dump database -Fc backup.dump
pg_restore -l backup.dump | sed '/MATERIALIZED VIEW DATA/d' > restore.lst
pg_restore -L restore.lst -d database backup.dump
pg_restore -l backup.dump | grep 'MATERIALIZED VIEW DATA' > refresh.lst
pg_restore -L refresh.lst -d database backup.dump
@viktorvillalobos

This comment has been minimized.

Copy link

@viktorvillalobos viktorvillalobos commented Oct 2, 2018

Excelent

@iam4x

This comment has been minimized.

Copy link

@iam4x iam4x commented Jun 11, 2020

Thanks 👍

@ndufrane

This comment has been minimized.

Copy link

@ndufrane ndufrane commented Sep 11, 2020

thx !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.