Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iNog2-0007tv-QE for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Oct 2019 01:46:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iNofz-0001FL-Ul for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Oct 2019 01:46:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iNofz-0001FE-Jm for pgsql-bugs@lists.postgresql.org; Fri, 25 Oct 2019 01:46:03 +0000 Received: from anastigmatix.net ([68.171.219.55]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iNofj-00061X-93 for pgsql-bugs@lists.postgresql.org; Fri, 25 Oct 2019 01:46:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=v3fh4h2Q5bH2B8I6I5LCf2tZucf9xdmYB+bbykxr7vE=; b=rvYGIv91gG7D6r0hOPlOItlzMK 05uqAd441KUTd/AVT3a88psmDF+ka/ROfbAOUhi+ZKPvKIKE/mEyZ7DCiU7xaq+9SHZ8hFx1VdUCt 58Nut+N0Wp90Cy6igr08TXtoPGdD8Of0aB5FR4FAreDXZM0j712l953EBoh24979OnZZns4yty3Sm C+1WC7HFdQGLkHDDJSEXOlrMaMefshyITNmg+QrC+Cc+CgWTggvaUbAF0tJRB0J2wYqjXoF+vMvgf Vc8VTuHjyrU4BY8Sw6qJCYOHagjYx2q+Z8UE4t97CXEk2w89IL73f4wtrulZwxFAQJc2I6IJE9958 U9awMFLw==; Received: from [184.19.31.139] (port=40634) by bay.acenet.us with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1iNofg-0055cN-RJ; Thu, 24 Oct 2019 21:45:45 -0400 Subject: Re: BUG #16046: xpath returns CDATA tag along with the value in postgres 12 To: Tom Lane , mostafa_bit0108@hotmail.com References: <16046-a04d0611e7a0c03a@postgresql.org> <10621.1571953091@sss.pgh.pa.us> <5DB23068.3080601@anastigmatix.net> Cc: pgsql-bugs@lists.postgresql.org, Markus Winand , Pavel Stehule From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5DB253C8.4020501@anastigmatix.net> Date: Thu, 24 Oct 2019 21:45:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <5DB23068.3080601@anastigmatix.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-94.5 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap@anastigmatix.net X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/24/19 19:14, Chapman Flack wrote: > Which may or may not be a good thing. Perhaps it could lead the unwary > in some cases to think such a query is giving a directly usable > text string back, which will be harmless until the one time a value > with escaping comes back. (The no-surprises way to get back a directly > usable text string, if that's what's wanted, would be with XMLTABLE > and an output column of text type.) If the original reporter is happy with getting xml back, instead of raw text, but only wants the form of escaping to be the same as it was in pg11, the xpath //cname/aname/text() can just be rewritten as string(//cname/aname), which will lose any CDATA-ness and consistently produce the form where individual characters are escaped, in 11 or 12. I think. Regards, -Chap