Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1evsPY-00031G-D1 for pgsql-general@arkaria.postgresql.org; Tue, 13 Mar 2018 22:28:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1evsPW-0000Yb-I0 for pgsql-general@arkaria.postgresql.org; Tue, 13 Mar 2018 22:28:46 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1evsPV-0000YR-UA for pgsql-general@lists.postgresql.org; Tue, 13 Mar 2018 22:28:46 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1evsPN-0004U1-ON for pgsql-general@postgresql.org; Tue, 13 Mar 2018 22:28:44 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id C9790210BB; Tue, 13 Mar 2018 18:28:35 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Tue, 13 Mar 2018 18:28:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Jp4mr0 CWjTc+U4DVSx+4Br3gg9o3vVXeGY4bf0ThrbU=; b=DdcFu98lGVd5wllk4AC+WQ G+Kk4WUKaZDbC/xR3Fholns5Hy558g9pg4176b1st8NeSC71ypa4XVA4oRZTmWlU eKS9fJCsPC5Jtjq2TuHH6zvn/LDlZ9Mt9CVP8R9wTgS8B+TuF4P3PUy+64mTSYf7 ov9ef45SjpX+ZvOiESpwIrzAPAl2/lIp7bbnFf6Pvie8I/8e2d2fk7ALfcR417HT B6JIM1JkFwRavO84QC9Q83Aue3RPAgED3IZe406fwCZPTXVKcHL1kUlHDJ806qCx XuysKttWI1MeKRT09l9hUy3SWJok9C1DEZMSLHOK863PEKHAC8DKqBtWc53rat+A == X-ME-Sender: Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 829E9241E2; Tue, 13 Mar 2018 18:28:35 -0400 (EDT) Subject: Re: query_to_xml() returns invalid XML when query returns no rows To: Thomas Kellerer , pgsql-general@postgresql.org References: From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <4a4ad503-c879-0afb-d307-c81107421422@2ndquadrant.com> Date: Tue, 13 Mar 2018 18:28:35 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/13/18 15:21, Thomas Kellerer wrote: > I still think it's incorrect to return an empty (=invalid) XML instead of a NULL value though. This behavior is specified in the SQL standard. While an empty string is not a valid XML "document", it is valid as XML "content". -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services