X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 4F797D1B482 for ; Fri, 9 Jan 2004 20:44:48 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 77351-07 for ; Fri, 9 Jan 2004 16:44:18 -0400 (AST) Received: from trolak.mydnsbox2.com (ns1.mydnsbox2.com [207.44.142.118]) by svr1.postgresql.org (Postfix) with ESMTP id 50E18D1B48E for ; Fri, 9 Jan 2004 16:44:15 -0400 (AST) Received: from dunslane.net (cpe-024-211-141-025.nc.rr.com [24.211.141.25]) (authenticated (0 bits)) by trolak.mydnsbox2.com (8.11.6/8.11.6) with ESMTP id i09Lfcb24865 for ; Fri, 9 Jan 2004 15:41:38 -0600 Message-ID: <3FFF129E.6020109@dunslane.net> Date: Fri, 09 Jan 2004 15:44:14 -0500 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030508 X-Accept-Language: en-us, en MIME-Version: 1.0 To: PostgreSQL-development Subject: Re: Encoding problems in PostgreSQL with XML data References: <303E00EBDD07B943924382E153890E5434AA48@cuthbert.rcsinc.local> In-Reply-To: <303E00EBDD07B943924382E153890E5434AA48@cuthbert.rcsinc.local> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/215 X-Sequence-Number: 48939 Perhaps the document should be stored in canonical form. See http://www.w3.org/TR/xml-c14n I think I agree with Rod's opinion elsewhere in this thread. I guess the "philosophical" question is this: If 2 XML documents with different encodings have the same canonical form, or perhaps produce the same DOM, are they equivalent? Merlin appears to want to say "no", and I think I want to say "yes". cheers andrew Merlin Moncure wrote: >Peter Eisentraut wrote: > > >>The central problem I have is this: How do we deal with the fact that >>an XML datum carries its own encoding information? >> >> > >Maybe I am misunderstanding your question, but IMO postgres should be >treating xml documents as if they were binary data, unless the server >takes on the role of a parser, in which case it should handle >unspecified/unknown encodings just like a normal xml parser would (and >this does *not* include changing the encoding!). > >According to me, an XML parser should not change one bit of a document, >because that is not a 'parse', but a 'transformation'. > > > >>Rewriting the declaration seems like a workable solution, but >> >> >it > > >>would break the transparency of the client/server encoding conversion. >>Also, some people might dislike that their documents are being changed >>as they are stored. >> >> > >Right, your example begs the question: why does the server care what the >encoding of the documents is (perhaps indexing)? ZML validation is a >standardized operation which the server (or psql, I suppose) can >subcontract out to another application. > >Just a side thought: what if the xml encoding type was built into the >domain type itself? >create domain xml_utf8 ... >Which allows casting, etc. which is more natural than an implicit >transformation. > >Regards, >Merlin > >---------------------------(end of broadcast)--------------------------- >TIP 8: explain analyze is your friend > > >