2010/8/2 Pavel Stehule <pavel.steh...@gmail.com>: > 2010/7/31 Robert Haas <robertmh...@gmail.com>: >> On Sat, Jul 31, 2010 at 8:10 AM, Peter Eisentraut <pete...@gmx.net> wrote: >>> On fre, 2010-07-30 at 12:50 +0100, Mike Fowler wrote: >>>> > * xml_is_well_formed returns true for simple text >>>> > >>>> > postgres=# SELECT xml_is_well_formed('ssss'); >>>> > xml_is_well_formed >>>> > -------------------- >>>> > t >>>> > (1 row) >>>> > >>>> > it is probably wrong result - is it ok?? >>>> > >>>> >>>> Yes this is OK, pure text is valid XML content. >>> >>> Are you speaking of XML content fragments that SQL/XML defines? >>> >>> Well-formedness should probably only allow XML documents. >> >> I think the point of this function is to determine whether a cast to >> xml will throw an error. The behavior should probably match exactly >> whatever test would be applied there. > > I agree with this idea - so I am able to do: > > postgres=# select 'xxx'::xml; > xml > ----- > xxx > (1 row) > > I have not any suggestions now - so I'll change flag to "ready to commit"
sorry - contrib module should be a fixed patch attached > > Regards > > Pavel Stehule > >> >> -- >> Robert Haas >> EnterpriseDB: http://www.enterprisedb.com >> The Enterprise Postgres Company >> >
*** ./contrib/xml2/pgxml.sql.in.orig 2010-03-01 19:07:59.000000000 +0100 --- ./contrib/xml2/pgxml.sql.in 2010-08-02 08:40:27.885789791 +0200 *************** *** 5,18 **** --SQL for XML parser - CREATE OR REPLACE FUNCTION xml_is_well_formed(text) RETURNS bool - AS 'MODULE_PATHNAME' - LANGUAGE C STRICT IMMUTABLE; - -- deprecated old name for xml_is_well_formed CREATE OR REPLACE FUNCTION xml_valid(text) RETURNS bool ! AS 'MODULE_PATHNAME', 'xml_is_well_formed' ! LANGUAGE C STRICT IMMUTABLE; CREATE OR REPLACE FUNCTION xml_encode_special_chars(text) RETURNS text AS 'MODULE_PATHNAME' --- 5,14 ---- --SQL for XML parser -- deprecated old name for xml_is_well_formed CREATE OR REPLACE FUNCTION xml_valid(text) RETURNS bool ! AS 'xml_is_well_formed' ! LANGUAGE INTERNAL STRICT IMMUTABLE; CREATE OR REPLACE FUNCTION xml_encode_special_chars(text) RETURNS text AS 'MODULE_PATHNAME' *** ./contrib/xml2/uninstall_pgxml.sql.orig 2007-11-13 05:24:29.000000000 +0100 --- ./contrib/xml2/uninstall_pgxml.sql 2010-08-02 08:38:40.134785878 +0200 *************** *** 29,33 **** -- deprecated old name for xml_is_well_formed DROP FUNCTION xml_valid(text); - - DROP FUNCTION xml_is_well_formed(text); --- 29,31 ----
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers