Re: [HACKERS] XML schemas and PG column names

2009-12-12 Thread Andrew Dunstan
Peter Eisentraut wrote: On lör, 2009-12-12 at 11:51 -0500, Andrew Dunstan wrote: It is certainly legal per XML and XSD specs, and the SQL/XML spec has annotations using appinfo elements. It would be rather surprising if the SQL/XML spec forbade annotations such as I propose. The spec is m

Re: [HACKERS] XML schemas and PG column names

2009-12-12 Thread Peter Eisentraut
On lör, 2009-12-12 at 11:51 -0500, Andrew Dunstan wrote: > It is certainly legal per XML and XSD specs, and the SQL/XML spec has > annotations using appinfo elements. It would be rather surprising if > the > SQL/XML spec forbade annotations such as I propose. The spec is > mind-bogglingly impene

Re: [HACKERS] XML schemas and PG column names

2009-12-12 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan writes: Tom Lane wrote: 2. What happens when the column name contains characters that would have to be escaped, such as "<" --- haven't you just replaced one de-escaping problem with another? But the difference is that the XML processor will

Re: [HACKERS] XML schemas and PG column names

2009-12-12 Thread Tom Lane
Andrew Dunstan writes: > Tom Lane wrote: >> 2. What happens when the column name contains characters that would have >> to be escaped, such as "<" --- haven't you just replaced one de-escaping >> problem with another? > But the difference is that the XML processor will automatically unescape > t

Re: [HACKERS] XML schemas and PG column names

2009-12-12 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan writes: I propose that we annotate the schema section RowType elements with the original names, so we would have something like this in the schema section: 1. Is that legal per the SQL/XML spec? It is certainly legal per XML and XSD specs, and the

Re: [HACKERS] XML schemas and PG column names

2009-12-12 Thread Tom Lane
Andrew Dunstan writes: > I propose that we annotate the schema section RowType elements with the > original names, so we would have something like this in the schema section: 1. Is that legal per the SQL/XML spec? 2. What happens when the column name contains characters that would have to be es

[HACKERS] XML schemas and PG column names

2009-12-12 Thread Andrew Dunstan
I'm doing some work with the output of query_to_xml_and_xmlschema(). The output is a bit unfortunate in my opinion when the column names in the query are not legal XML names. We quite reasonably translate the names so that legal XML names result, but we don't actually put the original name anyw