Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qySZ1-008bmu-VV for pgsql-docs@arkaria.postgresql.org; Thu, 02 Nov 2023 07:56:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qySYz-00BogQ-Cp for pgsql-docs@arkaria.postgresql.org; Thu, 02 Nov 2023 07:56:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qySYz-00BogH-5Z for pgsql-docs@lists.postgresql.org; Thu, 02 Nov 2023 07:56:25 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qySYs-003ZTw-5W for pgsql-docs@lists.postgresql.org; Thu, 02 Nov 2023 07:56:23 +0000 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2c514cbbe7eso9049551fa.1 for ; Thu, 02 Nov 2023 00:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1698911775; x=1699516575; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=PpII7zZUCo6Te4W8LOf+Kds4H2BtuVtHr5poQNPFBYg=; b=JYW2exrytFjkZDOLc6bFnhggBGkVdxnAgOduPiyzzgpX5OfM4jlgfLayI5sE3Qj9N+ g7U/L++Ep4DtG4ZPp4TvDGMyv+JcGe+QEK1bc2awfmUbMifWykY6s7v9OtfAuE31/Z6L ORVM7EQxTgHxGYi0G+vvfnBhmFqk6cRfh8HjDN+pjt8JtO/AhJDBHat4sVb2C3Wz5Wxu XkDhP2yGiu9dQ9GLHnr5NGIa47eGCLU1F+tbwP9aw2GL9NZcWPfFzeZOCjf2JJzyi9Ki MThW7kRxERJ7o0Dail8Ei+cn6JLeKAflu13HVVIF8U28r7ZUntl5ElnI7CgXN+kq+U4c spBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698911775; x=1699516575; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=PpII7zZUCo6Te4W8LOf+Kds4H2BtuVtHr5poQNPFBYg=; b=xNstZt1BAp9PoW+lDXQpDirLS4bwq6d1Pnrsenc+6I5rYKPoU5e1tKs4xbHfM048BE wl2vrsKVMw8FyuebnvpUfNj+4SH/RCF//ZOBjIxxTp6KRrKwNMvc+AaRpKEECAUJyQ2c Ksn57wT6ocN4cDMdfjufvtYq9NX+VLNBEBsr0PYah09abppGBcSfEBOJQ/wjutz6QL5b KZO58v9PL7Q+iC5Dh32jhD/Bbk6VIo+tAV7UNufbN8my++m3rNiVDGvqLwAnFSoSvdaH CNOUFXEBaFs0F5Bpn+7cN77TSeba+kkXLeP9YsS1xy8fypNA2EdRc6iQ8Iwk6ZUBnm+k TP1Q== X-Gm-Message-State: AOJu0YyBq695tNaNFGZD/MCLROOXh9BSXKFRqod+ylQx9plys25Mw+na NRLkpq74cr5HiImvaCS/t9cn8w== X-Google-Smtp-Source: AGHT+IEqqFe0oSjA+nd4w1aT2Blb79XhuJFLMiIA7jb3Hjd/nlo9uq4qD7bnuLAb3BVEMY/9uVqfcw== X-Received: by 2002:a2e:8185:0:b0:2c6:ec75:cf99 with SMTP id e5-20020a2e8185000000b002c6ec75cf99mr1632092ljg.32.1698911774651; Thu, 02 Nov 2023 00:56:14 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:671d:efcb:786d:3c60:89d1]) by smtp.gmail.com with ESMTPSA id q10-20020a05600c46ca00b00407efbc4361sm2025727wmo.9.2023.11.02.00.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 00:56:14 -0700 (PDT) Message-ID: Subject: Re: Documentation of return values of range functions lower and upper From: Laurenz Albe To: Bruce Momjian Cc: Fujii Masao , jani.rahkola@iki.fi, pgsql-docs@lists.postgresql.org Date: Thu, 02 Nov 2023 08:56:13 +0100 In-Reply-To: References: <160508672127.25505.8356390205508789564@wrigleys.postgresql.org> <53ec9f116bea9252d7fa9341e024530553656c42.camel@cybertec.at> <16601466752e40543051369fac722c0a200bb4e6.camel@cybertec.at> <27d690d8-0987-5f2b-a2da-fc2ec7c19e3c@oss.nttdata.com> <02f3fa3a592fa6c1f8ec1a9f539ae376f744eb42.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2023-11-01 at 18:03 -0400, Bruce Momjian wrote: > On Wed, Nov 1, 2023 at 09:40:43PM +0100, Laurenz Albe wrote: > > > Yes, I agree this documentation needs help. > > >=20 > > > For upper/lower(), it is clear that the documentation is better sayin= g > > > "unspecified" rather than infinite. The fact that upper/lower_inf() > > > returns false for +/-Infinity is quite odd, but should at least be > > > documented. > > >=20 > > > Patch attached. It is odd that +Infinity (vs. Infinity) wasn't > > > supported for datetime input until PG 16, but I think we have to say > > > +/-infinity vs (blank)/-Infinity. > > >=20 > > > Patch attached. > >=20 > > I am unhappy with "unspecified". A NULL value as upper or lower bound = has a very > > specific meaning, namely that the range is unbounded in that direction.= This is > > a bit confusing, since NULL is typically used for unknown or undefined = values. > >=20 > > I think it would be better to say "returns NULL if the range is empty o= r unbounded" > > and "is the range unbounded on the upper end?". >=20 > I had to go with "Is the multirange's lower bound unbounded?" because > the surrounding items use that sentence structure. Patch attached. Better, though "Is the range's upper bound unbounded?" makes me cringe. It is not the bound that is bounded or not, but the range. How about "Is the range unbounded at the upper end?" or "Does the range have no upper bound?" Yours, Laurenz Albe