Re: Using XMLNAMESPACES with XMLEMENT

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: Garfield Lewis <garfield(dot)lewis(at)lzlabs(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Using XMLNAMESPACES with XMLEMENT
Date: 2021-09-24 23:37:03
Message-ID: B61D9694-83D3-4F09-8AED-A6A45A9F66FD@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Sep 24, 2021, at 4:54 PM, Garfield Lewis <garfield(dot)lewis(at)lzlabs(dot)com> wrote:
>
> 
> I’m using PG v12.6 and no I haven’t tried the path function. Do you have an example?
>
> --
> Regards,
> Garfield A. Lewis
>
> From: Rob Sargent <robjsargent(at)gmail(dot)com>
> Date: Friday, September 24, 2021 at 6:52 PM
> To: Garfield Lewis <garfield(dot)lewis(at)lzlabs(dot)com>
> Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
> Subject: Re: Using XMLNAMESPACES with XMLEMENT
>
>
>
>
> On Sep 24, 2021, at 3:44 PM, Garfield Lewis <garfield(dot)lewis(at)lzlabs(dot)com> wrote:
>
> Hi All,
>
> I am attempting to port the following statement from DB2z to Postgres:
>
> SELECT e.empno, e.firstnme, e.lastname,
> XMLELEMENT ( NAME "foo:Emp",
> XMLNAMESPACES('http://www.foo.com' AS "foo"),
> XMLATTRIBUTES(e.empno as "serial"),
> e.firstnme,
> e.lastname ) AS "Result"
> FROM EMP e
> WHERE e.edlevel = 12;
>
> The NAMESPACES function is not supported by Postgres in the XMLELEMENT function. Is there any way to get this to work? I’ve looked at the WITH syntax but it doesn’t look like that will be helpful here.
>
>
> Which Postgres version? Have you tried path function?
> Regards,
> Garfield

https://www.postgresql.org/docs/12/functions-xml.html#FUNCTIONS-XML-PROCESSING

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Geoghegan 2021-09-24 23:43:35 Re: Frequetly updated partial index leads to bloat on index for Postresql 11
Previous Message Garfield Lewis 2021-09-24 22:54:54 Re: Using XMLNAMESPACES with XMLEMENT