← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stub/launchpad/trivial into lp:launchpad

 

Stuart Bishop has proposed merging lp:~stub/launchpad/trivial into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #951401 in Launchpad itself: "parse-ppa-apache-logs failing (missing files)"
  https://bugs.launchpad.net/launchpad/+bug/951401

For more details, see:
https://code.launchpad.net/~stub/launchpad/trivial/+merge/100397

= Summary =

Staging full restores are broken. The dumps from PostgreSQL 8.4 need help to automatically restore without errors under PG 9.1.

== Proposed fix ==

drop the plpgsql language, created automatically under PG 9.1, before restoring the dump from 8.4.

== Pre-implementation notes ==

== Implementation details ==

Error code for the droplang is ignored so this keeps working after Production is updated to PG 9.1.

== Tests ==

== Demo and Q/A ==


= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  database/replication/Makefile
-- 
https://code.launchpad.net/~stub/launchpad/trivial/+merge/100397
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stub/launchpad/trivial into lp:launchpad.
=== modified file 'database/replication/Makefile'
--- database/replication/Makefile	2011-12-03 05:51:50 +0000
+++ database/replication/Makefile	2012-04-02 12:19:28 +0000
@@ -111,6 +111,9 @@
 	    LAG="0 seconds"
 	# Create the DB with the desired default tablespace.
 	${CREATEDB} --tablespace ${STAGING_TABLESPACE} lpmain_staging_new
+	# Drop the plpgsql language if it was installed, as it will be
+	# recreated with the dump from PostgreSQL 8.4
+	-droplang plpgsql lpmain_staging_new
 	# Restore the database. We need to restore permissions, despite
 	# later running security.py, to pull in permissions granted on
 	# production to users not maintained by security.py.
@@ -162,6 +165,8 @@
 dogfood: DUMPLIST:=$(shell tempfile --suffix=.lst --prefix=lpdogf)
 dogfood:
 	${CREATEDB} ${DOGFOOD_DBNAME}
+	# May be needed with PG 9.1 if the dump is from PG 8.4.
+	-droplang plpgsql ${DOGFOOD_DBNAME}
 	pg_restore --list ${DOGFOOD_DUMP} | grep -v 'TRIGGER public _sl_' \
 	    > ${DUMPLIST}
 	pg_restore --dbname=${DOGFOOD_DBNAME} --no-acl --no-owner \