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 m...@mlfowler.com wrote: Robert Haas wrote: On Fri, Jul 9, 2010 at 4:06 PM, Peter Eisentraut pete...@gmx.net 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

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: pg:foo xmlns:pg=http://postgresql.org/stuff;bar/my:foo Undefined namespace when used in conjunction with IS DOCUMENT: pg:foo xmlns:my=http://postgresql.org/stuff;bar/pg:foo

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 m...@mlfowler.com 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

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 pete...@gmx.net 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

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

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 pete...@gmx.net 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

[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.

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

2010-07-03 Thread Mike Fowler
Quoting Peter Eisentraut pete...@gmx.net: 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

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-02 Thread Mike Fowler
Quoting Robert Haas robertmh...@gmail.com: I think the point if IS DOCUMENT is to distinguish a document: foosome stuffbar/baz//foo from a document fragment: bar/baz/ A document is allowed only one toplevel tag. It'd be nice, I think, to have a function that tells you whether something is

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

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

2010-07-01 Thread Mike Fowler
Quoting Mike Fowler m...@mlfowler.com: Should the IS DOCUMENT predicate support this? At the moment you get the following: template1=# SELECT 'townstownBidford-on-Avon/towntownCwmbran/towntownBristol/town/towns' IS DOCUMENT; ?column? -- t (1 row) template1=# SELECT

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 m...@mlfowler.com wrote: Quoting Mike Fowler m...@mlfowler.com: Should the IS DOCUMENT predicate support this? At the moment you get the following: template1=# SELECT 'townstownBidford-on-Avon/towntownCwmbran/towntownBristol/town/towns'  IS

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

[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

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 mber...@gmail.com 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

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 the

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 mrylan...@gmail.com 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

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 mrylan...@gmail.com 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

[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

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 mber...@gmail.com 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

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