From 86ebfe39caf2c47dd63c0a3883d9d744eaa2f979 Mon Sep 17 00:00:00 2001
From: Boris Kolpackov <boris@codesynthesis.com>
Date: Wed, 3 Feb 2016 19:33:42 +0200
Subject: Remove redundant DROP FUNCTION statement (casues error on older
 PostgreSQL)

---
 brep/package-extra.sql | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'brep/package-extra.sql')

diff --git a/brep/package-extra.sql b/brep/package-extra.sql
index 9a847e3..823c3af 100644
--- a/brep/package-extra.sql
+++ b/brep/package-extra.sql
@@ -8,7 +8,15 @@
 -- * strings other then function bodies must be quoted with ' or "
 -- * statements must end with ";\n"
 --
-DROP FUNCTION IF EXISTS to_tsvector(IN document weighted_text);
+
+-- There is no need to drop to_tsvector() explicitly, as we can rely on "DROP
+-- TYPE IF EXISTS weighted_text CASCADE" statement below, which will drop all
+-- objects that depend on this type. Moreover this DROP FUNCTION statement will
+-- fail for old versions of PostgreSQL (experienced for 9.2.14) with error:
+-- type "weighted_text" does not exist.
+--
+-- DROP FUNCTION IF EXISTS to_tsvector(IN document weighted_text);
+--
 DROP FUNCTION IF EXISTS search_packages(IN query tsquery, INOUT name TEXT);
 DROP FUNCTION IF EXISTS search_latest_packages(IN query tsquery);
 DROP FUNCTION IF EXISTS latest_package(INOUT name TEXT);
-- 
cgit v1.1

