← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/no-tsearch2-residue into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/no-tsearch2-residue into lp:launchpad with lp:~wgrant/launchpad/no-tsearch2 as a prerequisite.

Commit message:
Drop search_path and ts2 reside. All our stuff is now in public.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/no-tsearch2-residue/+merge/345521
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/no-tsearch2-residue into lp:launchpad.
=== modified file 'database/replication/Makefile'
--- database/replication/Makefile	2017-11-16 03:18:49 +0000
+++ database/replication/Makefile	2018-05-14 13:14:29 +0000
@@ -59,7 +59,7 @@
 	# XXX wgrant 2017-11-16: Exclude tsearch2 bits that are
 	# erreonously being dumped now.
 	pg_restore --list ${STAGING_DUMP} | grep -v 'TRIGGER public _sl_' \
-	    | grep -v 'OPERATOR FAMILY ts2' > ${DUMPLIST}
+	    > ${DUMPLIST}
 
 	# Deny new connections to the main DBs and kill any leftovers.
 	${STAGING_PGBOUNCER} -c 'DISABLE launchpad_staging'

=== modified file 'database/schema/Makefile'
--- database/schema/Makefile	2012-11-21 17:43:58 +0000
+++ database/schema/Makefile	2018-05-14 13:14:29 +0000
@@ -135,23 +135,9 @@
 
 # Confirm that launchpad-XX-00-0.sql hasn't been messed with - this file
 # is our baseline telling us what was installed into production
-check: search_path
+check:
 	@if [ "`md5sum ${BASELINE}`" != "${MD5SUM}" ]; then echo "* ${BASELINE} is corrupt or has been modified"; exit 1; else echo "* Using ${BASELINE} as baseline"; fi
 
-search_path:
-	@psql -d template1 -q -A -t -c 'show search_path'
-	@if [ `psql -d template1 -q -A -t -c 'show search_path'` != '$$user,public,ts2' ] && [ `psql -d template1 -q -A -t -c 'show search_path'` != '"$$user",public,ts2' ]; then \
-		echo "* It appears your search path is unconfigured."; \
-		echo "	Have you read <https://launchpad.canonical.com/DatabaseSetup>?";  \
-		echo; \
-		echo "* Add the following to /etc/postgresql/X.X/main/postgresql.conf"; \
-		echo " (where X.X is the version of the PostgreSQL DB you're connecting to):"; \
-		echo "    search_path='\$$user,public,ts2'"; \
-		echo "* Then reload PostgreSQL:";  \
-		echo "    sudo /etc/init.d/postgresql reload";  \
-		exit 1; \
-	 fi
-
 
 all: dev test
 	@ echo "* All done"
@@ -172,5 +158,5 @@
 	$(call build_new_sampledata,${TEMPLATE_WITH_TEST_SAMPLEDATA},${LINTDATA})
 	$(call build_new_sampledata,${TEMPLATE_WITH_DEV_SAMPLEDATA},${LINTDATA_DEV})
 
-.PHONY: default test dev create check search_path all doc diagram newsampledata_test newsampledata_dev newsampledata lintdata
+.PHONY: default test dev create check all doc diagram newsampledata_test newsampledata_dev newsampledata lintdata
 

=== modified file 'lib/lp/services/database/doc/textsearching.txt'
--- lib/lp/services/database/doc/textsearching.txt	2018-05-14 09:25:45 +0000
+++ lib/lp/services/database/doc/textsearching.txt	2018-05-14 13:14:29 +0000
@@ -3,8 +3,7 @@
 
 Introduction
 ------------
-We are currently using tsearch2 to provide full text searching
-capabilities inside the PostgreSQL database.
+We are currently using PostgreSQL's built-in full text search capabilities.
 
 Although in a lot of cases simple substring searches using LIKE would be
 fine or even preferred, the disadvantage of using LIKE is that PostgreSQL
@@ -12,31 +11,6 @@
 when we need to search tens of thousands of entries (packages) or hundreds
 of thousands of entries (people) or millions of entries (translations).
 
-Installation
-------------
-tsearch2 is part of the `postgresql-contrib` package. This is installed
-into the launchpad database using the script `database/schema/fti.py`,
-which is run automatically during database creation.
-
-This script does the following:
-
-    * Hooks `tsearch2` into the launchpad database, installing it into
-      the ts2 schema.
-
-    * Creates all the full text indexes. These are in the form of a new
-      column called `fti` on a number of tables. Which tables and
-      which columns are indexed is defined inside the fti.py script.
-
-    * Creates the `ftq(text)` stored procedure. This procedure makes
-      queries against the indexes simpler and consistant throughout
-      our applications.
-
-It is the Database Administrator's responsibility to rerun `fti.py` as
-part of the production rollouts if this script has been modified. It does
-not need to be rerun if the script has not changed. Rebuilding the indexes
-currently takes several minutes on production, during which time the
-production database is unavailable.
-
 Querying
 --------
 

=== modified file 'test_on_merge.py'
--- test_on_merge.py	2014-01-15 10:46:59 +0000
+++ test_on_merge.py	2018-05-14 13:14:29 +0000
@@ -120,14 +120,6 @@
     # bedrock is crumbling.
     con = psycopg2.connect('dbname=launchpad_ftest_template')
     cur = con.cursor()
-    cur.execute('show search_path')
-    search_path = cur.fetchone()[0]
-    if search_path != '$user,public,ts2':
-        print 'Search path incorrect.'
-        print 'Add the following line to /etc/postgresql/postgresql.conf:'
-        print "    search_path = '$user,public,ts2'"
-        print "and tell postgresql to reload its configuration file."
-        return 1
     cur.execute("""
         select pg_encoding_to_char(encoding) as encoding from pg_database
         where datname='launchpad_ftest_template'

=== modified file 'utilities/launchpad-database-setup'
--- utilities/launchpad-database-setup	2018-05-13 10:29:01 +0000
+++ utilities/launchpad-database-setup	2018-05-14 13:14:29 +0000
@@ -83,8 +83,6 @@
 ##
 ## Launchpad configuration
 ##
-# Enable launchpad full text searching in database
-search_path='$user,public,ts2'
 # Per Bug #90809, standard_conforming_strings should be 'on'
 standard_conforming_strings=off
 escape_string_warning=off


Follow ups