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 1iPsQU-0003Bh-AE for pgsql-bugs@arkaria.postgresql.org; Wed, 30 Oct 2019 18:10:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iPsQS-0005Bg-2W for pgsql-bugs@arkaria.postgresql.org; Wed, 30 Oct 2019 18:10:32 +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 1iPsQR-0005BY-Na for pgsql-bugs@lists.postgresql.org; Wed, 30 Oct 2019 18:10:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iPsQP-0002xn-Ck for pgsql-bugs@lists.postgresql.org; Wed, 30 Oct 2019 18:10:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x9UIAQIa015302; Wed, 30 Oct 2019 14:10:26 -0400 From: Tom Lane To: cherio@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16091: xpath fails to compute "name()", regression In-reply-to: <16091-a4296887079c549f@postgresql.org> References: <16091-a4296887079c549f@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Wed, 30 Oct 2019 16:58:33 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15300.1572459026.1@sss.pgh.pa.us> Date: Wed, 30 Oct 2019 14:10:26 -0400 Message-ID: <15301.1572459026@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > After upgrading postgresql from 9 to 12 the following statement no longer > produces the same result: SELECT xpath('name()', 'xyz'::XML) > PostgreSQL 9 returns '{abc}' > PostgreSQL 12 returns '{""}' > This behavior changed in version 11 and perpetuated into 12. This looks to me to be an intentional change in xpath's behavior. The v11 release notes call out the incompatibility: Correctly handle relative path expressions in xmltable(), xpath(), and other XML-handling functions (Markus Winand) Per the SQL standard, relative paths start from the document node of the XML input document, not the root node as these functions previously did. Perhaps 'name(/*)' would do what you want now. regards, tom lane