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 1kfQKD-0007jy-KX for pgsql-docs@arkaria.postgresql.org; Wed, 18 Nov 2020 16:28:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kfQKC-00008q-Dr for pgsql-docs@arkaria.postgresql.org; Wed, 18 Nov 2020 16:28:52 +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 1kfQKC-00008i-8P for pgsql-docs@lists.postgresql.org; Wed, 18 Nov 2020 16:28:52 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kfQK7-0002ae-BP for pgsql-docs@lists.postgresql.org; Wed, 18 Nov 2020 16:28:51 +0000 Received: by mail-wr1-x441.google.com with SMTP id l1so2769599wrb.9 for ; Wed, 18 Nov 2020 08:28:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=i3dXAxDYT16YAENKOS/ASKiLjRPzX6m+B+Z8NPUCBLI=; b=IMwS6YZLKisfGv4RbZQgNSo5c+um1ZDtaNR1CgOW9CXlDuWwug7btLqHRh5r/lcC0F vYT3fJC2EnVrcyGKRqMrzv8CfvBy0Ubn/s9ezDXsgOjrmyFUfnZWPfS/utp7woF5X4/d prGTJGhwGYtbV+rriQK10ks+NK+FzUueypGcJSOerKoayPAOo9cUjRFPKqajGzTMN/oK PNnf77T3/y95DaKPccjqFQV22JlmnZDwPWi9x8o1E+Zk/2lWZq6QMoo8VwBweELJWczj zFtl2Y29zMa7Qv33DMPr5jhFOWo3eQbQRcuulSy3gWoc7BOyMmpi8WqpBqAM4ja2k5m7 EEjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=i3dXAxDYT16YAENKOS/ASKiLjRPzX6m+B+Z8NPUCBLI=; b=UHjmnYzhyEp7apv5cGbbBq2jibuH8WAXvAl5WAcQt+6lSBQRYp2WJZb+AAt3TBGYqC 09aeKOMus+cpsUVow4kMsmf3o+53RrU9v3XYZvJjxwGpwHek085fz0gR8+k0bC+DyC28 huXydHDWFN68ggVAWBFHP6UjcJdXPsGYzEYoztvS1D+wUOMDiEnRDNZC40dPxi5mipqA EEsJ6HWGOq0mlL2Z2KRolzrTJG9esUJbe/s6zn8QnMPNk2HgvSfIE1Jy5peZEOmauXM+ T1DnF6cZiRTuCz4y45PklmOcXfI4IvdakMdFuQ1P7atDM5ZzoVy5F8RVLZ8W1I15g09/ 8trA== X-Gm-Message-State: AOAM531nlX1qzvRLpDd6dyOkpWPj5mQCSfFFWdxzrHGycck3aMCAFMJM 5Wll9dkq6oVD1OgFzK4ABLtgww== X-Google-Smtp-Source: ABdhPJw6/JUUQ6QikCLG+NfZBTOiuoWWFaFfaru5bD8dVlCehoaMIhQYdFXoBXDha92gC9qQlEttjg== X-Received: by 2002:adf:a191:: with SMTP id u17mr5715834wru.421.1605716925465; Wed, 18 Nov 2020 08:28:45 -0800 (PST) Received: from localhost.localdomain (217-149-169-56.nat.highway.telekom.at. [217.149.169.56]) by smtp.gmail.com with ESMTPSA id 71sm35363697wrm.20.2020.11.18.08.28.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 08:28:45 -0800 (PST) Message-ID: <02f3fa3a592fa6c1f8ec1a9f539ae376f744eb42.camel@cybertec.at> Subject: Re: Documentation of return values of range functions lower and upper From: Laurenz Albe To: Fujii Masao , jani.rahkola@iki.fi, pgsql-docs@lists.postgresql.org Date: Wed, 18 Nov 2020 17:28:44 +0100 In-Reply-To: <27d690d8-0987-5f2b-a2da-fc2ec7c19e3c@oss.nttdata.com> References: <160508672127.25505.8356390205508789564@wrigleys.postgresql.org> <53ec9f116bea9252d7fa9341e024530553656c42.camel@cybertec.at> <16601466752e40543051369fac722c0a200bb4e6.camel@cybertec.at> <27d690d8-0987-5f2b-a2da-fc2ec7c19e3c@oss.nttdata.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 2020-11-18 at 22:49 +0900, Fujii Masao wrote: > On 2020/11/12 17:14, Laurenz Albe wrote: > > > On Wed, 2020-11-11 at 18:19 +0100, Laurenz Albe wrote: > > > > Table 9.54 in page > > > > https://www.postgresql.org/docs/current/functions-range.html states that the > > > > functions lower and upper return NULL if the requested bound is infinite. If > > > > the element type of the range contains the special values infinity and > > > > -infinity, this is not correct, as those values are returned if explicitly > > > > used as either bound. > > > +1 > > > Perhaps it would be better to say > > > NULL if the range is empty or has no lower/upper bound > > I agree this description looks a bit confusing. But according to the section > "Infinite (Unbounded) Ranges" (*1), we already call "lower/upper bound > omitted" just infinite. So I don't think the current description is incorrect. > > (*1) > https://www.postgresql.org/docs/devel/rangetypes.html#RANGETYPES-INFINITE That is correct, but I'd argue that it would be better to clarify the paragraph too, in particular: The functions lower_inf and upper_inf test for infinite lower and upper bounds of a range, respectively. should better read The functions lower_inf and upper_inf test for omitted lower and upper bounds of a range, respectively. The rest of the paragraph is pretty unambiguous. Independent of this, I think that my patch for "upper" and "lower" would make the documentation clearer. Yours, Laurenz Albe