diff --git a/contrib/hstore/Makefile b/contrib/hstore/Makefile
index 24a9b02..872ca03 100644
--- a/contrib/hstore/Makefile
+++ b/contrib/hstore/Makefile
@@ -11,6 +11,7 @@ OBJS = \
 
 EXTENSION = hstore
 DATA = hstore--1.4.sql \
+	hstore--1.6--1.7.sql \
 	hstore--1.5--1.6.sql \
 	hstore--1.4--1.5.sql \
 	hstore--1.3--1.4.sql hstore--1.2--1.3.sql \
diff --git a/contrib/hstore/hstore--1.6--1.7.sql b/contrib/hstore/hstore--1.6--1.7.sql
new file mode 100644
index 0000000..08d7b35
--- /dev/null
+++ b/contrib/hstore/hstore--1.6--1.7.sql
@@ -0,0 +1,19 @@
+/* contrib/hstore/hstore--1.6--1.7.sql */
+
+-- complain if script is sourced in psql, rather than via ALTER EXTENSION
+\echo Use "ALTER EXTENSION hstore UPDATE TO '1.7'" to load this file. \quit
+
+ALTER OPERATOR ? (hstore, text)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ?| (hstore, text[])
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ?& (hstore, text[])
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR @> (hstore, hstore)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR <@ (hstore, hstore)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR @ (hstore, hstore)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ~ (hstore, hstore)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
diff --git a/contrib/hstore/hstore.control b/contrib/hstore/hstore.control
index e0fbb8b..f0da772 100644
--- a/contrib/hstore/hstore.control
+++ b/contrib/hstore/hstore.control
@@ -1,6 +1,6 @@
 # hstore extension
 comment = 'data type for storing sets of (key, value) pairs'
-default_version = '1.6'
+default_version = '1.7'
 module_pathname = '$libdir/hstore'
 relocatable = true
 trusted = true
diff --git a/contrib/ltree/Makefile b/contrib/ltree/Makefile
index 70c5e37..58a8295 100644
--- a/contrib/ltree/Makefile
+++ b/contrib/ltree/Makefile
@@ -15,7 +15,7 @@ OBJS = \
 PG_CPPFLAGS = -DLOWER_NODE
 
 EXTENSION = ltree
-DATA = ltree--1.1.sql ltree--1.0--1.1.sql
+DATA = ltree--1.1.sql ltree--1.0--1.1.sql ltree--1.1--1.2.sql
 PGFILEDESC = "ltree - hierarchical label data type"
 
 HEADERS = ltree.h
diff --git a/contrib/ltree/ltree--1.1--1.2.sql b/contrib/ltree/ltree--1.1--1.2.sql
new file mode 100644
index 0000000..cc70757
--- /dev/null
+++ b/contrib/ltree/ltree--1.1--1.2.sql
@@ -0,0 +1,86 @@
+/* contrib/ltree/ltree--1.1--1.2.sql */
+
+-- complain if script is sourced in psql, rather than via ALTER EXTENSION
+\echo Use "ALTER EXTENSION ltree UPDATE TO '1.2'" to load this file. \quit
+
+ALTER OPERATOR < (ltree, ltree)
+  SET (RESTRICT = scalarltsel, JOIN = scalarltjoinsel);
+ALTER OPERATOR <= (ltree, ltree)
+  SET (RESTRICT = scalarlesel, JOIN = scalarlejoinsel);
+ALTER OPERATOR >= (ltree, ltree)
+  SET (RESTRICT = scalargesel, JOIN = scalargejoinsel);
+ALTER OPERATOR > (ltree, ltree)
+  SET (RESTRICT = scalargtsel, JOIN = scalargtjoinsel);
+
+ALTER OPERATOR @> (ltree, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^@> (ltree, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR <@ (ltree, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^<@ (ltree, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ~ (ltree, lquery)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ~ (lquery, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^~ (ltree, lquery)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^~ (lquery, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ? (ltree, _lquery)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ? (_lquery, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^? (ltree, _lquery)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^? (_lquery, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR @ (ltree, ltxtquery)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR @ (ltxtquery, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^@ (ltree, ltxtquery)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^@ (ltxtquery, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR @> (_ltree, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR <@ (ltree, _ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR <@ (_ltree, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR @> (ltree, _ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ~ (_ltree, lquery)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ~ (lquery, _ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ? (_ltree, _lquery)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ? (_lquery, _ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR @ (_ltree, ltxtquery)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR @ (ltxtquery, _ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^@> (_ltree, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^<@ (ltree, _ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^<@ (_ltree, ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^@> (ltree, _ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^~ (_ltree, lquery)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^~ (lquery, _ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^? (_ltree, _lquery)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^? (_lquery, _ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^@ (_ltree, ltxtquery)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR ^@ (ltxtquery, _ltree)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
diff --git a/contrib/ltree/ltree.control b/contrib/ltree/ltree.control
index 3118df6..b408d64 100644
--- a/contrib/ltree/ltree.control
+++ b/contrib/ltree/ltree.control
@@ -1,6 +1,6 @@
 # ltree extension
 comment = 'data type for hierarchical tree-like structures'
-default_version = '1.1'
+default_version = '1.2'
 module_pathname = '$libdir/ltree'
 relocatable = true
 trusted = true
diff --git a/contrib/ltree/ltree_op.c b/contrib/ltree/ltree_op.c
index 2791037..8ad8a1d 100644
--- a/contrib/ltree/ltree_op.c
+++ b/contrib/ltree/ltree_op.c
@@ -561,6 +561,9 @@ ltree2text(PG_FUNCTION_ARGS)
 
 /*
  *	ltreeparentsel - Selectivity of parent relationship for ltree data types.
+ *
+ * This function is not used anymore, if the ltree extension has been
+ * updated to 1.2 or later.
  */
 Datum
 ltreeparentsel(PG_FUNCTION_ARGS)
diff --git a/contrib/pg_trgm/Makefile b/contrib/pg_trgm/Makefile
index f0a8d9c..d75e9ad 100644
--- a/contrib/pg_trgm/Makefile
+++ b/contrib/pg_trgm/Makefile
@@ -9,7 +9,7 @@ OBJS = \
 	trgm_regexp.o
 
 EXTENSION = pg_trgm
-DATA = pg_trgm--1.3--1.4.sql \
+DATA = pg_trgm--1.4--1.5.sql pg_trgm--1.3--1.4.sql \
 	pg_trgm--1.3.sql pg_trgm--1.2--1.3.sql pg_trgm--1.1--1.2.sql \
 	pg_trgm--1.0--1.1.sql
 PGFILEDESC = "pg_trgm - trigram matching"
diff --git a/contrib/pg_trgm/expected/pg_trgm.out b/contrib/pg_trgm/expected/pg_trgm.out
index 91596f8..19006f2 100644
--- a/contrib/pg_trgm/expected/pg_trgm.out
+++ b/contrib/pg_trgm/expected/pg_trgm.out
@@ -4013,16 +4013,15 @@ SELECT similarity('Szczecin', 'Warsaw');
 EXPLAIN (COSTS OFF)
 SELECT DISTINCT city, similarity(city, 'Warsaw'), show_limit()
   FROM restaurants WHERE city % 'Warsaw';
-                         QUERY PLAN                          
--------------------------------------------------------------
- Unique
-   ->  Sort
-         Sort Key: city, (similarity(city, 'Warsaw'::text))
-         ->  Bitmap Heap Scan on restaurants
-               Recheck Cond: (city % 'Warsaw'::text)
-               ->  Bitmap Index Scan on restaurants_city_idx
-                     Index Cond: (city % 'Warsaw'::text)
-(7 rows)
+                            QUERY PLAN                             
+-------------------------------------------------------------------
+ HashAggregate
+   Group Key: city, similarity(city, 'Warsaw'::text), show_limit()
+   ->  Bitmap Heap Scan on restaurants
+         Recheck Cond: (city % 'Warsaw'::text)
+         ->  Bitmap Index Scan on restaurants_city_idx
+               Index Cond: (city % 'Warsaw'::text)
+(6 rows)
 
 SELECT set_limit(0.3);
  set_limit 
diff --git a/contrib/pg_trgm/pg_trgm--1.4--1.5.sql b/contrib/pg_trgm/pg_trgm--1.4--1.5.sql
new file mode 100644
index 0000000..c0d9f6f
--- /dev/null
+++ b/contrib/pg_trgm/pg_trgm--1.4--1.5.sql
@@ -0,0 +1,15 @@
+/* contrib/pg_trgm/pg_trgm--1.4--1.5.sql */
+
+-- complain if script is sourced in psql, rather than via ALTER EXTENSION
+\echo Use "ALTER EXTENSION pg_trgm UPDATE TO '1.5'" to load this file. \quit
+
+ALTER OPERATOR % (text, text)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR <% (text, text)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR %> (text, text)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR <<% (text, text)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
+ALTER OPERATOR %>> (text, text)
+  SET (RESTRICT = matchsel, JOIN = matchjoinsel);
diff --git a/contrib/pg_trgm/pg_trgm.control b/contrib/pg_trgm/pg_trgm.control
index 831ba23..ed4487e 100644
--- a/contrib/pg_trgm/pg_trgm.control
+++ b/contrib/pg_trgm/pg_trgm.control
@@ -1,6 +1,6 @@
 # pg_trgm extension
 comment = 'text similarity measurement and index searching based on trigrams'
-default_version = '1.4'
+default_version = '1.5'
 module_pathname = '$libdir/pg_trgm'
 relocatable = true
 trusted = true
