Re: [PATCH] Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-12 Thread Thom Brown
On 12 July 2010 13:07, Mike Fowler wrote: > Thom Brown wrote: >> >> Just wondering about that semi-colon after the namespace definition. >> >> Thom >> > > The semi-colon is not supposed to be there, and I'm not sure where it's come > from. With Thunderbird I see the email with my patch as an attac

Re: [PATCH] Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-12 Thread Mike Fowler
Thom Brown wrote: Would a test for mismatched or undefined namespaces be necessary? For example: Mismatched namespace: http://postgresql.org/stuff";>bar Undefined namespace when used in conjunction with IS DOCUMENT: http://postgresql.org/stuff";>bar Thanks for looking at my patch Thom. I

Re: [PATCH] Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-12 Thread Thom Brown
On 10 July 2010 14:12, Mike Fowler wrote: > Robert Haas wrote: >> >> On Fri, Jul 9, 2010 at 4:06 PM, Peter Eisentraut wrote: >> >>> >>> On ons, 2010-07-07 at 16:37 +0100, Mike Fowler wrote: >>> Here's the patch to add the 'xml_is_well_formed' function. >>> >>> I suppose we should r

Re: [PATCH] Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-10 Thread Mike Fowler
Robert Haas wrote: On Fri, Jul 9, 2010 at 4:06 PM, Peter Eisentraut wrote: On ons, 2010-07-07 at 16:37 +0100, Mike Fowler wrote: Here's the patch to add the 'xml_is_well_formed' function. I suppose we should remove the function from contrib/xml2 at the same time. Yep R

Re: [PATCH] Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-09 Thread Robert Haas
On Fri, Jul 9, 2010 at 4:06 PM, Peter Eisentraut wrote: > On ons, 2010-07-07 at 16:37 +0100, Mike Fowler wrote: >> Here's the patch to add the 'xml_is_well_formed' function. > > I suppose we should remove the function from contrib/xml2 at the same > time. Yep. -- Robert Haas EnterpriseDB: http:

Re: [PATCH] Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-09 Thread Peter Eisentraut
On ons, 2010-07-07 at 16:37 +0100, Mike Fowler wrote: > Here's the patch to add the 'xml_is_well_formed' function. I suppose we should remove the function from contrib/xml2 at the same time. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscripti

[PATCH] Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-07 Thread Mike Fowler
Peter Eisentraut wrote: On lör, 2010-07-03 at 09:26 +0100, Mike Fowler wrote: What I will do instead is implement the xml_is_well_formed function and get a patch out in the next day or two. That sounds very useful. Here's the patch to add the 'xml_is_well_formed' function. Parap

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-03 Thread Peter Eisentraut
On lör, 2010-07-03 at 09:26 +0100, Mike Fowler wrote: > What I will do > instead is implement the xml_is_well_formed function and get a patch > out in the next day or two. That sounds very useful. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-03 Thread Mike Fowler
Quoting Peter Eisentraut : On fre, 2010-07-02 at 14:07 +0100, Mike Fowler wrote: So if IS CONTENT were to be implemented, to determine that you have something that is malformed But that's not what IS CONTENT does. "Content" still needs to be well-formed. What I was hoping to achieve was t

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-02 Thread Peter Eisentraut
On fre, 2010-07-02 at 14:07 +0100, Mike Fowler wrote: > So if IS CONTENT were > to be implemented, to determine that you have something that is > malformed But that's not what IS CONTENT does. "Content" still needs to be well-formed. -- Sent via pgsql-hackers mailing list (pgsql-hackers@p

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-02 Thread Mike Fowler
Quoting Robert Haas : I think the point if "IS DOCUMENT" is to distinguish a document: some stuff from a document fragment: A document is allowed only one toplevel tag. It'd be nice, I think, to have a function that tells you whether something is legal XML without throwing an error if it

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-01 Thread Robert Haas
On Thu, Jul 1, 2010 at 12:25 PM, Mike Fowler wrote: > Quoting Mike Fowler : > >> Should the IS DOCUMENT predicate support this? At the moment you get >> the following: >> >> template1=# SELECT >> >> 'Bidford-on-AvonCwmbranBristol' >>  IS >> DOCUMENT; >> ?column? >> -- >> t >> (1 row) >> >>

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-07-01 Thread Mike Fowler
Quoting Mike Fowler : Should the IS DOCUMENT predicate support this? At the moment you get the following: template1=# SELECT 'Bidford-on-AvonCwmbranBristol' IS DOCUMENT; ?column? -- t (1 row) template1=# SELECT 'Bidford-on-AvonCwmbranBristolIS DOCUMENT; ERROR: invalid XML content

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-06-30 Thread Alvaro Herrera
Excerpts from David Fetter's message of lun jun 28 12:00:47 -0400 2010: > While tracking this down, I didn't see a way to get SQLSTATE or the > corresponding condition name via psql. Is this an oversight? A bug, > perhaps? IIRC \pset VERBOSITY verbose to get the SQLSTATE. I don't think you can

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-06-28 Thread Mike Berrow
Yes, I went ahead and tried the original suggestion. Here is what the added function went in as: CREATE OR REPLACE FUNCTION xml_is_ok(x text) RETURNS boolean AS $BODY$ BEGIN PERFORM XMLPARSE( DOCUMENT x::XML ); RETURN TRUE; EXCEPTION WHEN OTHERS THEN RETURN FALSE; END; $BODY$ LANGUAGE 'plp

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-06-28 Thread Robert Haas
On Mon, Jun 28, 2010 at 11:03 AM, Mike Berrow wrote: > Is there some way to use the new, core XML functionality to simply return a > truth value > in the way that we need?. Have you tried using a wrapper function like the one suggested independently by Mike Rylander and David Fetter upthread? If

[HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-06-28 Thread Mike Berrow
We need to make extensive use of the 'xml_is_well_formed' function provided by the XML2 module. Yet the documentation says that the xml2 module will be deprecated since "XML syntax checking and XPath queries" is covered by the XML-related functionality based on the SQL/XML standard in the core ser

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-06-28 Thread Mike Fowler
Robert Haas wrote: On Mon, Jun 28, 2010 at 11:42 AM, Mike Rylander wrote: You could do something like this (untested): CREATE OR REPLACE FUNCTION my_xml_is_valid ( x TEXT ) RETURNS BOOL AS $$ BEGIN PERFORM XMLPARSE( DOCUMENT x::XML ); RETURN TRUE; EXCEPTION WHEN OTHERS THEN RETURN FALSE;

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-06-28 Thread Robert Haas
On Mon, Jun 28, 2010 at 11:42 AM, Mike Rylander wrote: > You could do something like this (untested): > > CREATE OR REPLACE FUNCTION my_xml_is_valid ( x TEXT ) RETURNS BOOL AS $$ > BEGIN >  PERFORM XMLPARSE( DOCUMENT x::XML ); >  RETURN TRUE; > EXCEPTION WHEN OTHERS THEN >  RETURN FALSE; > END; >

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-06-28 Thread David Fetter
On Mon, Jun 28, 2010 at 08:08:53AM -0700, Mike Berrow wrote: > We need to make extensive use of the 'xml_is_well_formed' function provided > by the XML2 module. > > Yet the documentation says that the xml2 module will be deprecated since > "XML syntax checking and XPath queries" > is covered by th

Re: [HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-06-28 Thread Mike Rylander
On Mon, Jun 28, 2010 at 11:08 AM, Mike Berrow wrote: > We need to make extensive use of the 'xml_is_well_formed' function provided > by the XML2 module. > Yet the documentation says that the xml2 module will be deprecated since > "XML syntax checking and XPath queries" > is covered by the XML-rela

[HACKERS] Issue: Deprecation of the XML2 module 'xml_is_well_formed' function

2010-06-28 Thread Mike Berrow
We need to make extensive use of the 'xml_is_well_formed' function provided by the XML2 module. Yet the documentation says that the xml2 module will be deprecated since "XML syntax checking and XPath queries" is covered by the XML-related functionality based on the SQL/XML standard in the core ser