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 1h5aZc-0005hk-1T for pgsql-general@arkaria.postgresql.org; Sun, 17 Mar 2019 18:31:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h5aZa-0005Bi-RL for pgsql-general@arkaria.postgresql.org; Sun, 17 Mar 2019 18:31:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5Wdf-00051G-MN for pgsql-general@lists.postgresql.org; Sun, 17 Mar 2019 14:19:47 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.122]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5Wdd-0005lS-JE for pgsql-general@postgresql.org; Sun, 17 Mar 2019 14:19:47 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 40591D7F; Sun, 17 Mar 2019 16:19:45 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zfE22P70Tpxv; Sun, 17 Mar 2019 16:19:43 +0200 (EET) Received: from mail.hot.ee (hot-relayhost3.estpak.ee [213.180.2.81]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 7AB80D42; Sun, 17 Mar 2019 16:19:43 +0200 (EET) Received: from dell2 (66-63-196-88.sta.estpak.ee [88.196.63.66]) (Authenticated sender: kobruleht2) by HOT-Relayhost3.estpak.ee (Postfix) with ESMTPSA id 44MhKB2zSzzHs; Sun, 17 Mar 2019 16:19:41 +0200 (EET) Message-ID: From: "Andrus" To: "Pavel Stehule" Cc: "pgsql-general" References: In-Reply-To: Subject: Re: How to parse XML in Postgres newer versions also Date: Sun, 17 Mar 2019 16:19:33 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi! >You can use XMLTABLE function >select xmltable.* > from t, > lateral > xmltable(xmlnamespaces('urn:iso:std:iso:20022:tech:xsd:camt.053.001.02' as > ns), > > '/ns:Document/ns:BkToCstmrStmt/ns:Stmt/ns:Ntry/.' passing t.x > columns tasusumma numeric path 'ns:Amt') In 9.1.5 this throws error ERROR: syntax error at or near "(" LINE 20: lateral xmltable(xmlnamespaces( ^ SQL state: 42601 Character: 582 Andrus.