Обсуждение: pg_upgrade to 15 fails on Windows because of xml_is_well_formed()

Поиск
Список
Период
Сортировка

pg_upgrade to 15 fails on Windows because of xml_is_well_formed()

От
Thomas Kellerer
Дата:
When trying pg_upgrade to upgrade Postgres 14 to 15 on Windows 10 this fails with:

pg_restore: creating FUNCTION "public.xml_is_well_formed("text")"
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 647; 1255 23216 FUNCTION xml_is_well_formed("text") postgres
pg_restore: error: could not execute query: ERROR:  could not find function "xml_is_well_formed" in file "c:/Program
Files/PostgreSQL/15/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';

The same error occurs when trying pg_dump/pg_restore, but the restore continues without further errors and the database
isusable after that.
 

I don't understand why this functions is included in the dump in the first place.
A pristine 15 cluster already contains that function.


Any ideas?
Thomas




Re: pg_upgrade to 15 fails on Windows because of xml_is_well_formed()

От
Tom Lane
Дата:
Thomas Kellerer <shammat@gmx.net> writes:
> When trying pg_upgrade to upgrade Postgres 14 to 15 on Windows 10 this fails with:
> pg_restore: error: could not execute query: ERROR:  could not find function "xml_is_well_formed" in file "c:/Program
Files/PostgreSQL/15/lib/pgxml.dll"

> I don't understand why this functions is included in the dump in the first place.

Indeed.  No such function should be present in any version of contrib/xml2
that was ever converted to extension style.  Have you never done that
in this DB?

            regards, tom lane



Re: pg_upgrade to 15 fails on Windows because of xml_is_well_formed()

От
Thomas Kellerer
Дата:
Tom Lane schrieb am 13.10.2022 um 21:01:
>> When trying pg_upgrade to upgrade Postgres 14 to 15 on Windows 10 this fails with:
>> pg_restore: error: could not execute query: ERROR:  could not find function "xml_is_well_formed" in file "c:/Program
Files/PostgreSQL/15/lib/pgxml.dll"
>
>> I don't understand why this functions is included in the dump in the first place.
>
> Indeed.  No such function should be present in any version of contrib/xml2
> that was ever converted to extension style.  Have you never done that
> in this DB?

Hmm, the xml2 extension is not installed in any of those databases.

Most databases were probably migrated over time from 8.4
and I can't rule out that I did install xml2 there at some time
in the past.

I checked pg_proc and it the function was there twice: one in pg_catalog
and one in the public schema.

After manually dropping the function from the public schema, pg_upgrade went through.

It's probably not worth investigating how it got there.

I tried to create and drop the xml2 extension to see if that maybe leaves
the "orphaned" function in the public schema, but I couldn't reproduce it.

Regards
Thomas





Re: pg_upgrade to 15 fails on Windows because of xml_is_well_formed()

От
Adrian Klaver
Дата:
On 10/13/22 12:45, Thomas Kellerer wrote:
> Tom Lane schrieb am 13.10.2022 um 21:01:
>>> When trying pg_upgrade to upgrade Postgres 14 to 15 on Windows 10 

> Hmm, the xml2 extension is not installed in any of those databases.
> 
> Most databases were probably migrated over time from 8.4
> and I can't rule out that I did install xml2 there at some time
> in the past.
> 
> I checked pg_proc and it the function was there twice: one in pg_catalog
> and one in the public schema.

The one in the public schema would seem to be the smoking gun that 
points at xml2 having been installed from contrib in pre-extension days.


> Regards
> Thomas
> 
> 
> 
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com