Heroku Postgres xml2 extension deprecated

Change effective on 08 March 2024

We deprecated the xml2 PostgreSQL extension on all Heroku Postgres databases. The PostgreSQL project deprecated the xml2 extension in version 8.3 in February 2008. If you currently use the extension, you can use the built-in XML functions, the built-in xml type, and SQL/XML standards support instead. These functions are available on all Heroku Postgres databases.

If your app or database uses any of the following deprecated functions, you must update the app or database to use the built-in PostgreSQL XML functionality. If you haven’t updated your app or database, any queries, stored procedures, or PL/PGSQL using the deprecated functions fail. Future database migrations and upgrades also won’t complete, leaving the database in an unusable state.

Deprecated functions Supported functions
xml_valid xml_is_well_formed
xpath_string, xpath_number, xpath_bool xpath, possibly in combination with xpath functions: string(), number(), bool()
xpath_nodeset xpath
xpath_list xpath
xpath_table xmltable

If you haven’t removed the extension, Heroku will force-drop it starting on April 19, 2024. After migrating away from the deprecated functions, drop the xml2 extension from each database by running the command in a psql session:


For more information on extensions, see Extensions, PostGIS, and Full Text Search Dictionaries on Heroku Postgres.