Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1swNd5-003TU2-MC for pgsql-general@arkaria.postgresql.org; Thu, 03 Oct 2024 15:20:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1swNd4-00Gvck-TV for pgsql-general@arkaria.postgresql.org; Thu, 03 Oct 2024 15:20:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1swNd4-00Gvc0-3x for pgsql-general@lists.postgresql.org; Thu, 03 Oct 2024 15:20:34 +0000 Received: from omta002.cacentral1.a.cloudfilter.net ([3.97.99.33]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1swNcz-002Mn6-Py for pgsql-general@postgresql.org; Thu, 03 Oct 2024 15:20:33 +0000 Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTPS id wJwes7BFlMArNwNczsIBcM; Thu, 03 Oct 2024 15:20:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=shaw.ca; s=s20231031; t=1727968829; bh=Y1RUUTTrKJosvdxIFu5HRTyg6rTqZJlof4rw2E7kn44=; h=Message-ID:Date:Subject:To:From; b=vLr/z5fPqrbZ8ehCLq05B7xEtAAEfF0mlnB5c5Po4XZXLzOT0MDuNsCNxgcivxIgK qKlR8X2WmPiy17Gydr4IstUYPb4/mTf0lfwpPu1fLI7L4xfbvL3x/rBxmpbwrYhC14 bjDp5rKpZwmY7khav3ezSjv5N2GiAZSTxrwLu3dWGAVNhXRdojd68eXVrQ51ZtJjG3 ZLbZUEZfGqBsCZ+zESugcpotFheeJZOvtzoaQnLUfwgMHS6P1zehCBUHsTpuncVLy6 muS9B6b66AnbtXVbh3MwUbr3XhFRaWQ1yMggevRFM6qnUotg3wx/w3zyYdsrNNSqbt BGc9XkyhfvT5Q== Received: from [192.168.2.11] ([142.161.62.170]) by cmsmtp with ESMTPSA id wNcysayzCE0IVwNczsZJRJ; Thu, 03 Oct 2024 15:20:29 +0000 Authentication-Results: ; auth=pass (PLAIN) smtp.auth=gweaver@shaw.ca X-Auth-User: gweaver X-Authority-Analysis: v=2.4 cv=cI9DsUeN c=1 sm=1 tr=0 ts=66feb63d a=ZMt2Fn/+eO0oV/ZMl6lE+Q==:117 a=ZMt2Fn/+eO0oV/ZMl6lE+Q==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=_Dj-zB-qAAAA:8 a=gTzTCxonVKCBtV6dd8kA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=bot0f9TY0_v3QD3QSigA:9 a=x-gVY2TtdBkYHZyv:21 a=_W_S_7VecoQA:10 a=lqcHg5cX4UMA:10 Content-Type: multipart/alternative; boundary="------------yiE700foDrs3nFtM3v2i6jXb" Message-ID: Date: Thu, 3 Oct 2024 10:20:28 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: How to handle "could not find function xml_is_well_formed" when restoring database in Version 17 Content-Language: en-US To: "pgsql-general@postgresql.org" References: <1865149.1727803723@sss.pgh.pa.us> From: George Weaver Organization: Cleartag Software, Inc. In-Reply-To: <1865149.1727803723@sss.pgh.pa.us> X-CMAE-Envelope: MS4xfG5LpUc/ANzggpmSsU8EY5PsRaArdEYtkxmhxI1GNXx585GQk0Txk/Qw2KRsTmoyppM0CilGOcrtQ6up8+QLkk8xlBhjePJ/CNVJZTumQpiVOoX6Z+KD H6S+6EmcGV6xFVNky2NOHf+GyQB1WGHOjRPdLBlIYtyUcP/13laooE0aTosSiyAlYwnz58CvE6dml4DYYS8GOjnrNubBPRgACW0= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------yiE700foDrs3nFtM3v2i6jXb Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Thanks Tom and Christoph, Got it! The function xml_valid is also gone.  Does xml_is_well_formed accomplish the same objective? Thanks, George On 01/10/2024 12:28 p.m., Tom Lane wrote: > George Weaver writes: >> I am testing upgrading from Version 13 to Version 17.  I am getting the >> following error when trying to restore a database in Version 17 (the >> database was backed up from Version 13 using the Version 17 pg_dump): >> pg_Restore: error: could not execute query: ERROR:  could not find >> function "xml_is_well_formed" in file "C:/Program >> Files/PostgreSQL/17/lib/pgxml.dll" >> Command was: CREATE FUNCTION public.xml_is_well_formed(text) RETURNS >> boolean >>     LANGUAGE c IMMUTABLE STRICT >>     AS '$libdir/pgxml', 'xml_is_well_formed'; > What you appear to have here is a pre-9.1 version of the xml2 > extension. That is so old that you're going to have difficulty > modernizing it. We used to provide scripts for converting those > loose objects into extensions, but we got rid of them in v13, > figuring that after ten years their usefulness had passed. > > I think what you will have to do is manually drop all the xml2 > functions (look for pg_proc entries with '$libdir/pgxml' in probin) > from the v13 database, then upgrade, then install the xml2 extension > if you still want it. Fortunately that module only provided functions > not datatypes, so this shouldn't be too painful. (Another way could > be to manually remove those CREATE FUNCTION commands from the dump > script.) > > I'm betting that this database has a lot of other deferred > maintenance that you ought to think about while you're at it. > If there are any other old-style extensions in there, better > fix them up. > > regards, tom lane --------------yiE700foDrs3nFtM3v2i6jXb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Thanks Tom and Christoph,

Got it!

The function xml_valid is also gone.  Does xml_is_well_formed accomplish the same objective?

Thanks,

George

On 01/10/2024 12:28 p.m., Tom Lane wrote:
George Weaver <gweaver@shaw.ca> writes:
I am testing upgrading from Version 13 to Version 17.  I am getting the 
following error when trying to restore a database in Version 17 (the 
database was backed up from Version 13 using the Version 17 pg_dump):

      
    pg_Restore: error: could not execute query: ERROR:  could not find
    function "xml_is_well_formed" in file "C:/Program
    Files/PostgreSQL/17/lib/pgxml.dll"
    Command was: CREATE FUNCTION public.xml_is_well_formed(text) RETURNS
    boolean
         LANGUAGE c IMMUTABLE STRICT
         AS '$libdir/pgxml', 'xml_is_well_formed';
What you appear to have here is a pre-9.1 version of the xml2
extension.  That is so old that you're going to have difficulty
modernizing it.  We used to provide scripts for converting those
loose objects into extensions, but we got rid of them in v13,
figuring that after ten years their usefulness had passed.

I think what you will have to do is manually drop all the xml2
functions (look for pg_proc entries with '$libdir/pgxml' in probin)
from the v13 database, then upgrade, then install the xml2 extension
if you still want it.  Fortunately that module only provided functions
not datatypes, so this shouldn't be too painful.  (Another way could
be to manually remove those CREATE FUNCTION commands from the dump
script.)

I'm betting that this database has a lot of other deferred
maintenance that you ought to think about while you're at it.
If there are any other old-style extensions in there, better
fix them up.

			regards, tom lane

  


--------------yiE700foDrs3nFtM3v2i6jXb--