Re: review: xml_is_well_formed

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Mike Fowler <mike(at)mlfowler(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: review: xml_is_well_formed
Date: 2010-08-06 21:46:52
Message-ID: AANLkTinqrqP8u3rvbwUmofRtoOdFDDWebPkHJQu7Jhgo@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 6, 2010 at 4:52 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> On fre, 2010-08-06 at 07:31 -0400, Robert Haas wrote:
>> > What about making the function sensitive to the XML OPTION, such
>> that:
>> >
>> > test=# SET xmloption TO DOCUMENT;
>> > SET
>> > text=# SELECT xml_is_well_formed('foo');
>> >
>> >  xml_is_well_formed
>> >  --------------------
>> >  f
>> >  (1 row)
>>
>> That will make using this function a huge hassle, won't it?  Functions
>> that do different things depending on GUC settings are usually
>> troublesome.  Having three functions would be more sensible if we need
>> all three behaviors, but I don't see why we do.
>
> Upthread you opined that this function should essentially indicate
> whether a cast to type xml would succeed, and observing the xmloption is
> an essential part of that.  I had assumed the original patch actually
> did that.

Oh.

I didn't realize the casting behavior was already dependent on the GUC. Yuck.

Maybe we should following the GUC after all, then.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-08-06 22:01:58 Re: Initial review of xslt with no limits patch
Previous Message Tom Lane 2010-08-06 21:46:07 Re: gincostestimate