Re: query_to_xml nulls set to false

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Lynn Dobbs <lynn(at)creditlink(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: query_to_xml nulls set to false
Date: 2011-07-29 14:32:01
Message-ID: 1311949921.5813.13.camel@fsopti579.F-Secure.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On mån, 2011-07-11 at 18:54 -0700, Lynn Dobbs wrote:
> I am using query_to_xml with nulls set to false in postgresql 9.0.4.
> (I believe the behavior was also present in 8.4.)
>
> The documentation for query_to_xml says that if set to true, nulls
> with be treated with xsi:nil="true" and "An appropriate namespace
> declaration will be added to the result value. If false, columns
> containing null values are simply omitted from the output."
>
> This suggests to me that if set to false, there should be no added
> namespace declaration, but, in practice, the xsi namespace is present.
>
> Is this the designed, intentional behavior or accidental?

The xsi namespace is always added, but this is an implementation detail,
it's not something that has to be one way or another. The XML is
equivalent, after all.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message woow 2011-07-29 15:16:32 Newbiee Pls help.....
Previous Message Tom Lane 2011-07-29 14:01:22 Re: How to implement autostart of postgres?