← Back to team overview

launchpad-reviewers team mailing list archive

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

 

You have been requested to review the proposed merge of lp:~wgrant/launchpad/pg10-dump-restore into lp:launchpad.

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/pg10-dump-restore/+merge/366376

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.


-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/pg10-dump-restore into lp:launchpad.
=== modified file 'database/replication/Makefile'
--- database/replication/Makefile	2019-03-25 08:09:12 +0000
+++ database/replication/Makefile	2019-04-23 05:14:37 +0000
@@ -56,8 +56,8 @@
 stagingsetup:
 	# List the dump first to make sure it is usable before destroying
 	# anything.
-	pg_restore --list ${STAGING_DUMP} | grep -v 'TRIGGER public _sl_' \
-	    > ${DUMPLIST}
+	pg_restore --list ${STAGING_DUMP} | \
+	    grep -v -E 'TRIGGER public [^ ]+ _sl_' > ${DUMPLIST}
 
 	# Deny new connections to the main DBs and kill any leftovers.
 	${STAGING_PGBOUNCER} -c 'DISABLE launchpad_staging'
@@ -103,8 +103,8 @@
 dogfood: DUMPLIST:=$(shell tempfile --suffix=.lst --prefix=lpdogf)
 dogfood:
 	${CREATEDB} ${DOGFOOD_DBNAME}
-	pg_restore --list ${DOGFOOD_DUMP} | grep -v 'TRIGGER public _sl_' \
-	    > ${DUMPLIST}
+	pg_restore --list ${DOGFOOD_DUMP} | \
+	    grep -v -E 'TRIGGER public [^ ]+ _sl_' > ${DUMPLIST}
 	pg_restore --dbname=${DOGFOOD_DBNAME} --no-acl --no-owner \
 	    --use-list=${DUMPLIST} ${EXIT_ON_ERROR} ${MULTIPROC} ${DOGFOOD_DUMP}
 	rm ${DUMPLIST}


References