Merge lp:~wgrant/launchpad/pg10-dump-restore into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 18936
Proposed branch: lp:~wgrant/launchpad/pg10-dump-restore
Merge into: lp:launchpad
Diff against target: 25 lines (+4/-4)
1 file modified
database/replication/Makefile (+4/-4)
To merge this branch: bzr merge lp:~wgrant/launchpad/pg10-dump-restore
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Stuart Bishop (community) Approve
Review via email: mp+366376@code.launchpad.net

Commit message

Fix staging and dogfood restores to exclude Slony triggers from PostgreSQL 10.

Description of the change

pg_dump in PostgreSQL 9.6 started to include table names in trigger tags. Since
we don't expect to ever again restore a dump from before production was
upgraded to PostgreSQL 10, just update the Slony exclusion greps to expect the
new format instead.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

Yup

review: Approve
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'database/replication/Makefile'
2--- database/replication/Makefile 2019-03-25 08:09:12 +0000
3+++ database/replication/Makefile 2019-04-23 05:14:37 +0000
4@@ -56,8 +56,8 @@
5 stagingsetup:
6 # List the dump first to make sure it is usable before destroying
7 # anything.
8- pg_restore --list ${STAGING_DUMP} | grep -v 'TRIGGER public _sl_' \
9- > ${DUMPLIST}
10+ pg_restore --list ${STAGING_DUMP} | \
11+ grep -v -E 'TRIGGER public [^ ]+ _sl_' > ${DUMPLIST}
12
13 # Deny new connections to the main DBs and kill any leftovers.
14 ${STAGING_PGBOUNCER} -c 'DISABLE launchpad_staging'
15@@ -103,8 +103,8 @@
16 dogfood: DUMPLIST:=$(shell tempfile --suffix=.lst --prefix=lpdogf)
17 dogfood:
18 ${CREATEDB} ${DOGFOOD_DBNAME}
19- pg_restore --list ${DOGFOOD_DUMP} | grep -v 'TRIGGER public _sl_' \
20- > ${DUMPLIST}
21+ pg_restore --list ${DOGFOOD_DUMP} | \
22+ grep -v -E 'TRIGGER public [^ ]+ _sl_' > ${DUMPLIST}
23 pg_restore --dbname=${DOGFOOD_DBNAME} --no-acl --no-owner \
24 --use-list=${DUMPLIST} ${EXIT_ON_ERROR} ${MULTIPROC} ${DOGFOOD_DUMP}
25 rm ${DUMPLIST}