← 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:
  Stuart Bishop (stub)
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/134419

= Summary =

Most of our PostgreSQL extensions where installed before PostgreSQL added the extension mechanism. We should update them to the new world order to make maintenance easier.

== Proposed fix ==

== Pre-implementation notes ==

== LOC Rationale ==

== Implementation details ==

== Tests ==

== Demo and Q/A ==


= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  database/schema/patch-2209-39-0.sql
  database/schema/security.cfg
-- 
https://code.launchpad.net/~stub/launchpad/trivial/+merge/134419
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== added file 'database/schema/patch-2209-39-0.sql'
--- database/schema/patch-2209-39-0.sql	1970-01-01 00:00:00 +0000
+++ database/schema/patch-2209-39-0.sql	2012-11-15 09:11:27 +0000
@@ -0,0 +1,73 @@
+SET client_min_messages=ERROR;
+
+CREATE EXTENSION plpythonu FROM unpackaged;
+CREATE EXTENSION debversion FROM unpackaged;
+
+-- Per PGBug 7661, clean our our old unpackaged pgstattuple. It is too
+-- ancient for the 9.1.6 upgrade script to work with.
+DROP FUNCTION pgstattuple(text);
+DROP FUNCTION pgstattuple(oid);
+DROP FUNCTION IF EXISTS pgstatindex(text);
+DROP FUNCTION IF EXISTS pg_relpages(text);
+
+CREATE EXTENSION pgstattuple;
+
+-- Similarly, our tsearch2 compatibility dates from 8.3 and fails to upgrade.
+-- No bug reported here, as we may have messed with our tsearch2 stuff.
+-- Manually create the missing bits, sourcing code from
+-- extensions/tsearch2--1.0.sql
+CREATE OPERATOR CLASS ts2.gist_tsvector_ops
+FOR TYPE tsvector USING gist
+AS
+        OPERATOR        1       @@ (tsvector, tsquery),
+        FUNCTION        1       gtsvector_consistent (internal,
+                                    gtsvector, int, oid, internal),
+        FUNCTION        2       gtsvector_union (internal, internal),
+        FUNCTION        3       gtsvector_compress (internal),
+        FUNCTION        4       gtsvector_decompress (internal),
+        FUNCTION        5       gtsvector_penalty (
+                                    internal, internal, internal),
+        FUNCTION        6       gtsvector_picksplit (internal, internal),
+        FUNCTION        7       gtsvector_same (
+                                    gtsvector, gtsvector, internal),
+        STORAGE         gtsvector;
+
+CREATE OPERATOR CLASS ts2.gist_tp_tsquery_ops
+FOR TYPE tsquery USING gist
+AS
+        OPERATOR        7       @> (tsquery, tsquery),
+        OPERATOR        8       <@ (tsquery, tsquery),
+        FUNCTION        1       gtsquery_consistent (
+                                    internal, internal, int, oid, internal),
+        FUNCTION        2       gtsquery_union (internal, internal),
+        FUNCTION        3       gtsquery_compress (internal),
+        FUNCTION        4       gtsquery_decompress (internal),
+        FUNCTION        5       gtsquery_penalty (
+                                    internal, internal, internal),
+        FUNCTION        6       gtsquery_picksplit (internal, internal),
+        FUNCTION        7       gtsquery_same (bigint, bigint, internal),
+        STORAGE         bigint;
+
+CREATE OPERATOR CLASS ts2.gin_tsvector_ops
+FOR TYPE tsvector USING gin
+AS
+        OPERATOR        1       @@ (tsvector, tsquery),
+        OPERATOR        2       @@@ (tsvector, tsquery),
+        FUNCTION        1       bttextcmp(text, text),
+        FUNCTION        2       gin_extract_tsvector(
+                                    tsvector,internal,internal),
+        FUNCTION        3       gin_extract_tsquery(
+                                    tsquery,internal,smallint,
+                                    internal,internal,internal,internal),
+        FUNCTION        4       gin_tsquery_consistent(
+                                    internal,smallint,tsquery,int,
+                                    internal,internal,internal,internal),
+        FUNCTION        5       gin_cmp_prefix(text,text,smallint,internal),
+        STORAGE         text;
+
+
+CREATE EXTENSION tsearch2 SCHEMA ts2 FROM unpackaged;
+
+
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 39, 0);

=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg	2012-11-07 12:38:19 +0000
+++ database/schema/security.cfg	2012-11-15 09:11:27 +0000
@@ -70,6 +70,8 @@
 public.person_sort_key(text, text)         = EXECUTE
 public.pgstattuple(oid)                    =
 public.pgstattuple(text)                   =
+public.pgstatindex(text)                   =
+public.pg_relpages(text)                   =
 public.pillarname                          = SELECT
 public.replication_lag()                   = EXECUTE
 public.replication_lag(integer)            = EXECUTE


Follow ups