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