Different behavior seen by xpath() function after upgrade to GPDB
search cancel

Different behavior seen by xpath() function after upgrade to GPDB

book

Article ID: 402194

calendar_today

Updated On:

Products

VMware Tanzu Data Suite

Issue/Introduction

xpath() function call in GPDB 7 is returning CDATA element which is not seen in the same function call on GPDB 6

Cause

The xpath() function on GPDB7 is generating additional text ("<![CDATA[....]]>") surrounding the result which is not similar to the behavior seen when run on GP6

this new behavior on GPDB7 is caused by the change in Postgres' xpath() function behavior on Postgres 12 with respect to handling CDATA sections.

 

The original reporting of this issue is documented in BUG# 16046

The rationale / justification behind the existence of the same behavior on Postgres 12 is explained in the linked page.

Resolution

While this is a newly expected design starting Postgres12,  the course of action to remediate any effect of this behavior is generally dependent on the issue/error which is manifested by the behavior.

In the case if this behavior is causing adverse effect or errors during subsequent operation to parse the generated xpath() output, REPLACE() function may be used to match the result to the pre-upgrade result by the. full operation.