← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/l-d-s-cleanup into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/l-d-s-cleanup into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/l-d-s-cleanup/+merge/114599

Drop some remaining PostgreSQL 8.4 support, since we only support 9.1 now.
-- 
https://code.launchpad.net/~wgrant/launchpad/l-d-s-cleanup/+merge/114599
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/l-d-s-cleanup into lp:launchpad.
=== modified file 'database/schema/Makefile'
--- database/schema/Makefile	2012-05-11 05:21:08 +0000
+++ database/schema/Makefile	2012-07-12 10:04:37 +0000
@@ -106,9 +106,6 @@
 # database schema, full text indexes and grants into it.
 # It will also create session DBs for the test and dev environments.
 # No sample data is added at this point.
-# NB. PG 9.1 has plpgsql installed in the template databases.
-# We can remove the stanzas that install plpgsql when we no longer support
-# PG 8.4.
 create:
 	@ echo "* If this fails you need to run as the postgresql superuser"
 	@ echo "* eg. sudo -u postgres make create"
@@ -129,18 +126,10 @@
 	@ echo "* Creating session database '${SESSION_DBNAME}' (if necessary)"
 	@if [ "$$((`psql -l | grep -w ${SESSION_DBNAME} | wc -l`))" = '0' ]; \
 	    then ${CREATEDB} template0 ${SESSION_DBNAME} ; \
-	    if [ "$$((`createlang -l ${SESSION_DBNAME} \
-		| grep plpgsql | wc -l`))" = '0' ]; \
-		then createlang plpgsql ${SESSION_DBNAME}; \
-	    fi; \
 	    psql -q -d ${SESSION_DBNAME} -f launchpad_session.sql ; \
 	fi
 	@ echo "* Creating session database '${TEST_SESSION_DBNAME}'"
 	@ ${CREATEDB} template0 ${TEST_SESSION_DBNAME}
-	@if [ "$$((`createlang -l ${TEST_SESSION_DBNAME} \
-	    | grep plpgsql | wc -l`))" = '0' ]; \
-	    then createlang plpgsql ${TEST_SESSION_DBNAME}; \
-	fi
 	@ psql -q -d ${TEST_SESSION_DBNAME} -f launchpad_session.sql
 
 # Confirm that launchpad-XX-00-0.sql hasn't been messed with - this file

=== modified file 'utilities/launchpad-database-setup'
--- utilities/launchpad-database-setup	2012-02-07 14:53:38 +0000
+++ utilities/launchpad-database-setup	2012-07-12 10:04:37 +0000
@@ -18,7 +18,7 @@
 # https://dev.launchpad.net/DatabaseSetup which are intended for
 # initial Launchpad setup on an otherwise unconfigured postgresql instance
 
-for pgversion in 9.1 8.4
+for pgversion in 9.1
 do
   sudo grep -q "^auto" /etc/postgresql/$pgversion/main/start.conf
   if [ $? -eq 0 ]; then

=== removed file 'utilities/launchpad-database-setup-pre-maverick'
--- utilities/launchpad-database-setup-pre-maverick	2010-09-17 11:59:56 +0000
+++ utilities/launchpad-database-setup-pre-maverick	1970-01-01 00:00:00 +0000
@@ -1,114 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2009 Canonical Ltd.  This software is licensed under the
-# GNU Affero General Public License version 3 (see the file LICENSE).
-
-if [ -n "$1" ]; then
-    USER=$1
-    echo "Creating Launchpad database for $USER"
-else
-    echo "usage: launchpad-database-setup DEVELOPER_USER"
-    echo "THIS SCRIPT WILL DESTROY ALL POSTGRESQL DATA for the given user"
-    echo "If you really want that, run it with the username of your "
-    echo "local developer account."
-    exit 1
-fi
-
-# This attempts to automate instructions provided on
-# https://dev.launchpad.net/DatabaseSetup which are intended for
-# initial Launchpad setup on an otherwise unconfigured postgresql instance
-
-for pgversion in 8.4 8.3 8.2
-do
-  if [ -e /etc/init.d/postgresql-$pgversion ]
-  then
-    break
-  fi
-done
-
-if [ -z "$pgversion" ]
-then
-  echo "Unable to determine your postgres version."
-  exit 1
-fi
-
-echo "Using postgres $pgversion"
-
-# Make sure that we have the correct version running on port 5432
-sudo grep -q "port.*5432" /etc/postgresql/$pgversion/main/postgresql.conf
-if [ $? -ne 0 ]; then
-  echo "Please check /etc/postgresql/$pgversion/main/postgresql.conf and"
-  echo "ensure postgres is running on port 5432."
-fi;
-
-sudo /etc/init.d/postgresql-$pgversion stop
-
-echo Purging postgresql data...
-sudo pg_dropcluster $pgversion main --stop-server
-echo Re-creating postgresql database...
-# Setting locale to C to make the server run in that locale.
-LC_ALL=C sudo pg_createcluster $pgversion main --encoding UNICODE
-
-echo Applying postgresql configuration changes...
-
-sudo cp -a /etc/postgresql/$pgversion/main/pg_hba.conf \
-    /etc/postgresql/$pgversion/main/pg_hba.conf.old
-sudo grep -q Launchpad /etc/postgresql/$pgversion/main/pg_hba.conf || \
-sudo patch /etc/postgresql/$pgversion/main/pg_hba.conf <<'EOF'
---- pg_hba.conf 2005-11-02 17:33:08.000000000 -0800
-+++ /tmp/pg_hba.conf    2005-11-03 07:32:46.932400423 -0800
-@@ -58,7 +58,9 @@
- # on a non-local interface via the listen_addresses configuration parameter,
- # or via the -i or -h command line switches.
- #
--
-+# Launchpad users
-+local   all         all                           trust
-+host    all         all         127.0.0.1/32      trust
-
-
-
-EOF
-sudo chown --reference=/etc/postgresql/$pgversion/main/pg_hba.conf.old \
-    /etc/postgresql/$pgversion/main/pg_hba.conf
-sudo chmod --reference=/etc/postgresql/$pgversion/main/pg_hba.conf.old \
-    /etc/postgresql/$pgversion/main/pg_hba.conf
-
-sudo grep -q Launchpad /etc/postgresql/$pgversion/main/postgresql.conf || \
-sudo tee -a /etc/postgresql/$pgversion/main/postgresql.conf <<'EOF'
-
-##
-## Launchpad configuration
-##
-# Enable launchpad full text searching in database
-search_path='$user,public,ts2'
-add_missing_from=false
-#enable_seqscan=false
-log_statement='none'
-log_line_prefix='[%t] %q%u@%d '
-fsync = off
-
-EOF
-
-if [ "$pgversion" = 8.2 -o "$pgversion" = 8.3 ]
-then
-  sudo grep -q '^[[:space:]]*max_fsm_relations' /etc/postgresql/$pgversion/main/postgresql.conf || \
-  sudo tee -a /etc/postgresql/$pgversion/main/postgresql.conf <<'EOF'
-max_fsm_relations=2000
-
-EOF
-fi
-
-sudo /etc/init.d/postgresql-$pgversion start
-
-echo Waiting 10 seconds for postgresql to come up...
-sleep 10
-
-echo Creating postgresql user $USER
-sudo -u postgres /usr/lib/postgresql/$pgversion/bin/createuser -a -d $USER
-
-echo
-echo Looks like everything went ok.
-echo Now run '"make schema"' at the top level of the launchpad tree.
-
-exit 0


Follow ups