Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1padnr-0002Od-Jc for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Mar 2023 14:33:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1padnq-000591-Fl for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Mar 2023 14:33:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1padnq-00058s-6X for pgsql-hackers@lists.postgresql.org; Fri, 10 Mar 2023 14:33:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1padnn-0002Ln-Rp for pgsql-hackers@lists.postgresql.org; Fri, 10 Mar 2023 14:33:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 32AEWu1N803305; Fri, 10 Mar 2023 09:32:56 -0500 From: Tom Lane To: Jim Jones cc: Peter Smith , Peter Eisentraut , Nikolay Samokhvalov , PostgreSQL Hackers , Andrey Borodin Subject: Re: [PATCH] Add pretty-printed XML output option In-reply-to: <906cfd1d-63a0-3cf5-7291-2dadb2e149ff@uni-muenster.de> References: <2f5df461-dad8-6d7d-4568-08e10608a69b@uni-muenster.de> <4c2efca5-8257-2424-6687-07c65e319e95@uni-muenster.de> <2eac4d78-2b20-e8ec-54cc-22a88653a1cc@uni-muenster.de> <6cb296fe-4b49-3691-633e-2e2366997b04@uni-muenster.de> <3baf8f25-3bd7-7db5-0b31-e4c92b6269ba@enterprisedb.com> <1cbe1087-6acb-2b0a-dc9b-0a2d5b99e466@uni-muenster.de> <532259.1678393296@sss.pgh.pa.us> <906cfd1d-63a0-3cf5-7291-2dadb2e! 149ff@uni-muenster.de> Comments: In-reply-to Jim Jones message dated "Fri, 10 Mar 2023 14:30:07 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <803303.1678458776.1@sss.pgh.pa.us> Date: Fri, 10 Mar 2023 09:32:56 -0500 Message-ID: <803304.1678458776@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jim Jones writes: > On 09.03.23 21:21, Tom Lane wrote: >> I've looked through this now, and have some minor complaints and a major >> one. The major one is that it doesn't work for XML that doesn't satisfy >> IS DOCUMENT. For example, > How do you suggest the output should look like? I'd say a series of node trees, each starting on a separate line. >> I also suspect that it's outright broken to attach a header claiming >> the data is now in UTF8 encoding. If the database encoding isn't >> UTF8, then either that's a lie or we now have an encoding violation. > I was mistakenly calling xml_parse with GetDatabaseEncoding(). It now > uses the encoding of the given doc and UTF8 if not provided. Mmmm .... doing this differently from what we do elsewhere does not sound like the right path forward. The input *is* (or had better be) in the database encoding. regards, tom lane