Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpEXv-0002Aq-UW for pgsql-general@arkaria.postgresql.org; Thu, 31 Jan 2019 15:46:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gpEXu-00031b-JY for pgsql-general@arkaria.postgresql.org; Thu, 31 Jan 2019 15:46:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpEXu-00031U-4R for pgsql-general@lists.postgresql.org; Thu, 31 Jan 2019 15:46:30 +0000 Received: from miami.speedyservers.com ([195.8.196.32]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpEXq-0002I2-IC for pgsql-general@postgresql.org; Thu, 31 Jan 2019 15:46:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=selestial.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zuqQ/xg4cxzI0VukNnpVtRTFPcrbqLdIdouoRnC1KFc=; b=ltiNlhdGjZuvBWwfdnoUGuo/EI ii+zV9L75m5/W56lssp7PWKLimNbz6cjUetBMz1WBYRquawwmsBCH92gTUH3G6sEQT+Elq2+hFy/X FE6L5H5slfPBk1a78pYPjAsGaxO/zz0r4LOZwZSTr09b3vE0Qv7z5y9jDr5Rz3X2L442spE9i3baW x0u+297VrOd5NI0JTgHKbsNoqnV3zcwHFQwC5vtc0sqep9YYi//x5/aGRKewJ3LzKiOIRTH9IIrT9 3+pfdvK5tI7Xj1d0poU940MlZvNxO1qXc4tJ4SaIZ2DQeBUFlrzUzms4yuCoNiVMtx6e9NbO8znNC RV4arHKw==; Received: from static-87-75-114-0.vodafonexdsl.co.uk ([87.75.114.0]:16722 helo=[192.168.0.10]) by miami.speedyservers.com with esmtpa (Exim 4.91) (envelope-from ) id 1gpEXm-00EzhO-Pk; Thu, 31 Jan 2019 15:46:22 +0000 Subject: Re: Old tsearch functions To: Tom Lane Cc: Adrian Klaver , pgsql-general References: <077abc5d-0ffe-5a54-38b3-a36cbcaeec48@selestial.com> <010c5d24-f704-3e44-ba5a-1855ecb8e0b3@aklaver.com> <9bee7649-5b5c-d4fb-85fb-06cd28e2b3a6@selestial.com> <25915.1548871728@sss.pgh.pa.us> <697c10e7-867a-a56d-4ae0-4e084717d044@selestial.com> <2708.1548946691@sss.pgh.pa.us> From: Howard News Message-ID: <2d19eef3-23cd-3797-cf4d-44b2e8e54e05@selestial.com> Date: Thu, 31 Jan 2019 15:47:18 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <2708.1548946691@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - miami.speedyservers.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - selestial.com X-Get-Message-Sender-Via: miami.speedyservers.com: authenticated_id: howardnews@selestial.com X-Authenticated-Sender: miami.speedyservers.com: howardnews@selestial.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 31/01/2019 14:58, Tom Lane wrote: > Howard News writes: >> On 30/01/2019 18:08, Tom Lane wrote: >>> Note that if you had those functions laying around ever since 8.3, >>> they're probably just "loose" and not wrapped into an extension at all. >> unfortunately running >> create extension tsearch2 from unpackaged; >> caused the following error: >> ERROR: operator family "gist_tsvector_ops" does not exist for access >> method "gist" > That's odd, the tsearch2 extension has certainly been stagnant since > 8.3. I wonder if the set of tsearch2 objects you have is even older > than that. > >> So I think I will have to create a script to delete the functions etc >> individually unless someone has another idea. > I'd try trimming down the tsearch2--unpackaged--1.0.sql script until > it succeeds. (Don't assume that you've got the exact same set of > objects in every DB, either ...) > >> For the tables that contain tsvector columns, is it OK to just run the >> following, or will i need to rebuild the associated index? >> ALTER TABLE public.mytable >>     ALTER COLUMN fts TYPE tsvector ; > The ALTER COLUMN will take care of rebuilding indexes, but just for > certainty I'd suggest spelling that "TYPE pg_catalog.tsvector". > > regards, tom lane Thanks again Tom. You may be correct about how old the version of tsearch was. I have not seen the tsearch2--unpackaged--1.0.sql script yet, but the following seems to cope ok. It works on both the 9.5 version and the 11.1 version. [CODE] begin; -- Repeat the line below for each table with public.tsvector column: alter table if exists mytable_with_fts business alter column fts type pg_catalog.tsvector; drop domain if exists public.tsvector; drop domain if exists public.tsquery; drop domain if exists public.gtsvector; drop domain if exists public.gtsq; -- This is how I created a list of functions in the public namespace -- SELECT 'DROP FUNCTION ' || ns.nspname || '.' || proname --       || '(' || oidvectortypes(proargtypes) || ');' -- FROM pg_proc INNER JOIN pg_namespace ns ON (pg_proc.pronamespace = ns.oid) -- WHERE ns.nspname = 'public'  order by proname; drop function if exists public._get_parser_from_curcfg(); drop function if exists public.concat(tsvector, tsvector); drop function if exists public.headline(text, tsquery); drop function if exists public.headline(oid, text, tsquery); drop function if exists public.headline(text, tsquery, text); drop function if exists public.headline(oid, text, tsquery, text); drop function if exists public.length(tsvector); drop function if exists public.lexize(oid, text); drop function if exists public.numnode(tsquery); drop function if exists public.parse(oid, text); drop function if exists public.parse(oid, text); drop function if exists public.parse(text); drop function if exists public.parse(text,text); drop function if exists public.plainto_tsquery(text); drop function if exists public.plainto_tsquery(oid, text); drop function if exists public.plpgsql_call_handler(); drop function if exists public.plpgsql_validator(oid); drop function if exists public.querytree(tsquery); drop function if exists public.rank(tsvector, tsquery); drop function if exists public.rank(real[], tsvector, tsquery); drop function if exists public.rank(tsvector, tsquery, integer); drop function if exists public.rank(real[], tsvector, tsquery, integer); drop function if exists public.rank_cd(tsvector, tsquery); drop function if exists public.rank_cd(real[], tsvector, tsquery); drop function if exists public.rank_cd(tsvector, tsquery, integer); drop function if exists public.rank_cd(real[], tsvector, tsquery, integer); drop function if exists public.rewrite(tsquery, text); drop function if exists public.rewrite(tsquery, tsquery, tsquery); drop function if exists public.setweight(tsvector, "char"); drop function if exists public.show_curcfg(); drop function if exists public.stat(text); drop function if exists public.stat(text, text); drop function if exists public.strip(tsvector); drop function if exists public.to_tsquery(text); drop function if exists public.to_tsquery(oid, text); drop function if exists public.to_tsvector(text); drop function if exists public.to_tsvector(oid, text); drop function if exists public.token_type(integer); drop function if exists public.token_type(text); drop function if exists public.token_type(); drop function if exists public.ts_debug(text); drop function if exists public.tsq_mcontained(tsquery, tsquery); drop function if exists public.tsq_mcontains(tsquery, tsquery); drop function if exists public.tsquery_and(tsquery, tsquery); drop function if exists public.tsquery_not(tsquery); drop function if exists public.tsquery_or(tsquery, tsquery); drop type if exists public.statinfo; drop type if exists public.tokenout; drop type if exists public.tokentype; drop type if exists public.tsdebug; commit; [/CODE]