Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hL9rQ-0004fR-HE for pgsql-docs@arkaria.postgresql.org; Mon, 29 Apr 2019 17:14:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hL9rO-0002ec-PL for pgsql-docs@arkaria.postgresql.org; Mon, 29 Apr 2019 17:14:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hL9rO-0002eV-Hw for pgsql-docs@lists.postgresql.org; Mon, 29 Apr 2019 17:14:34 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hL9rM-0004Vh-31 for pgsql-docs@lists.postgresql.org; Mon, 29 Apr 2019 17:14:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=HgjALVhCrIhGBEs/b1U8DrBwxrXR4PIBbWzCtWWpkPg=; b=EkP3sCBkoKmLgAGhmFzBq4VWVb cr8DweAwx7doGZJSLYTaQhCXKCkIg2f4tVqBNLT9F3AieOpUQByqPHbGKLfaT48jEi91Ks778WT2U B2NetQb+mT1cNwvVSccQyxkCD+I29uhCVcygmWeHdlBYTQguGKC+SYA3Mmarv39xcWbjGe2AZPTDE nLIrS9cbQvcbQLso++/uf3ZDsmTFi9BEO86Lpbdqdgt1NJ3D8ICnK0y6kmMfZBeIQt/3aMwVYAkJb EGmuHbSKWIKqPF1IlJvzLc+Wm9HbKRkUbGd68eeYuROdd6t/2pVBB+qF9rFmbyAH1TN6QP/jxT49s 3O+jgoLg==; Received: from [63.118.15.50] (helo=Ph33r-Retina.local) by meldrar.postgresql.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hL9rI-0003rD-Mk; Mon, 29 Apr 2019 17:14:31 +0000 Subject: Re: Why 'infinity' is not in range '[2019-01-02, infinity]'? To: kes-kes@yandex.ru, pgsql-docs@lists.postgresql.org, PG Doc comments form References: <155655432452.1371.6115195379691603427@wrigleys.postgresql.org> From: "Jonathan S. Katz" Openpgp: preference=signencrypt Autocrypt: addr=jkatz@postgresql.org; keydata= mQINBFtShwABEAC7PNHDUOTYuifpUCk23KqfxdQQkn4nkoxOXRK0+rAj36FiwqGB4TJFuOVZ sDFAEiSlC8Jt4y5Cs7B5tetT8JNd2cs6zp/udMJJDz9d65O9PDpdlMgAmIiTzpLlSdx8FG56 DTksaDv1d8j3cTJPSE4/fWSxqzA7o3Y9UuL7atZPrzfImgpRKs0of7elIHwOa8GucjyhYqcR h60wFBJc2KXqQdDYRTZy43DSnY/0VNc0omiH355fustvpm+m5HjD3w7qZyfN3fpKJpnX1LCF f3MnPHaDGITIYGRCBXvf0UqUtD6OEVWPv2C2gyqWMIpWmZTOgDufltKyIByKBoS9x0PlFkij 04X3KODCngt+N8Ssc9OICc6QSxhjoP48PYPdmiTmkrGuf0LX084wj1xeo1NX7XxZK39F6dTJ DhsIiW0sNS0xMxQHLHG9VLbPjx3SANQBh6BuryPz5ZupW9/TIDmkvprtU/oXfKgtfYm3fxmk EctxbWrEPsFTFPyuMqQu6l+xyQv0s1VLZfjNWaua6H1/gGoIt6kRnn5qMXDVVpijuWkHbv7G ngaQMd258UrrOEHnnjzhQ7jxMWV9D+emxbAtlIxnYvCWlV4IwAQhEHfvudqYaIY3hNWrvQ6H GB2KXoTZYN9g5djm14/5n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FTbH2OrMWIRfUdUCH1Djbuo65svhNj7FNsQVYzHDI+Nd1I/LOBoPc3UorRMF2M4JV kUR7skOHWUbPTSNUr7qc14NSMY3PKjGeVGAsBVHBPvmRx/Ss2tW/TpJWpxg4pmquFQSXuaYh Yf4FN8Sxy320pcr+FqN8AhZkYJcNY82OTtR5VEKRC/mYcyq61qXIKqngydn79bJjGxHipxyF FmEC Message-ID: <5f6b986b-de4d-8a43-1366-fc8c3aed6319@postgresql.org> Date: Mon, 29 Apr 2019 13:14:25 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <155655432452.1371.6115195379691603427@wrigleys.postgresql.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LhDIzfrLhnkATP0NIkiL6jLKIhlDueJIy" X-Host-Lookup-Failed: Reverse DNS lookup failed for 63.118.15.50 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LhDIzfrLhnkATP0NIkiL6jLKIhlDueJIy Content-Type: multipart/mixed; boundary="S0r6opC3H6ylkbR4cBMqIuiJKltqK4b1H"; protected-headers="v1" From: "Jonathan S. Katz" To: kes-kes@yandex.ru, pgsql-docs@lists.postgresql.org, PG Doc comments form Message-ID: <5f6b986b-de4d-8a43-1366-fc8c3aed6319@postgresql.org> Subject: Re: Why 'infinity' is not in range '[2019-01-02, infinity]'? References: <155655432452.1371.6115195379691603427@wrigleys.postgresql.org> In-Reply-To: <155655432452.1371.6115195379691603427@wrigleys.postgresql.org> --S0r6opC3H6ylkbR4cBMqIuiJKltqK4b1H Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 4/29/19 12:12 PM, PG Doc comments form wrote: > The following documentation comment has been logged on the website: >=20 > Page: https://www.postgresql.org/docs/11/rangetypes.html > Description: >=20 > Hi. >=20 > May I read this: >=20 > But [today,infinity] means something different from [today,infinity) =E2= =80=94 the > latter excludes the special timestamp value infinity. >=20 > as=20 >=20 > But [today,infinity] means something different from [today,infinity) =E2= =80=94 the > **first includes** the special timestamp value infinity. >=20 > But previous paragraph says: >=20 > But note that these infinite values are never values of the range's ele= ment > type, and can never be part of the range. (So there is no such thing as= an > inclusive infinite bound =E2=80=94 if you try to write one, it will aut= omatically be > converted to an exclusive bound.) >=20 > if 'infinity' can not be the part of a range this will mean: >=20 > [today,infinity] means same as [today,infinity) >=20 > errr... which one is correct? Please fix documentation. 'infinity' in that case is a special type of date/timestamp: https://www.postgresql.org/docs/current/datatype-datetime.html#id-1.5.7.1= 3.19.8 which is what that paragraph is referring to. It's discussing "infinity-like" objects you may see that are different than how range types treat infinity. I re-read the language, I would not advocate for making any changes. > PS. The problem I am faced into: > I am implementing be-temporal interface. I have current period. It can = be > [2019-01-01,2019-02-01), > [2019-02-01,2019-03-01) and [2019-03-01,infinity) for the current month= =2E >=20 > When I setup current_period to one of those I will get Orders at that > period. The Orders have with 'last_bill_date' field which will show the= date > of Invoice for that Order. > For new Order we can set 'infinity' into 'last_bill_date' which will me= an > that we should create Invoice. > Now to select all Order for which we should create Invoice we can write= : >=20 > select * from "order" o where o.last_bill_date +interval o.bill_interva= l <@ > current_period(); >=20 > This seems obvious that infinity is part of [value, infinity) ( or > [value,infinity] ) range. (in other words the 'infinity' is always the = part > of range with infinite inclusive or exclusive bound. >=20 > This is just view from my point, there can be things that I am not awar= e of. You should drop the 'infinity' and just let it be NULL, i.e. daterange('2019-03-01', NULL); Jonathan --S0r6opC3H6ylkbR4cBMqIuiJKltqK4b1H-- --LhDIzfrLhnkATP0NIkiL6jLKIhlDueJIy Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE+oS2la8r95ogZD/x8QSccp8cZScFAlzHMPIACgkQ8QSccp8c ZSeO+RAAjrR0RHilo9TXG1S9y6Li8vnoyMeIl82Jl2BjFFzNIQ+JG5mE4zh59bBJ 3ZfHCtB6oZ87RExOIHpZO3VxXQ1FkszYu4+cdXjplS1hPHdISHh+VGuzGaCuKExN 9PRKiA9WA0x6J9qwzjlx+qT7zwEE5qkVdFgJYi/5r6P3cODcCa+bhIL48GqdKV14 RR91mMsCp14Benf9jv1ob2xwTqmJRwDKSxRKtEBv/JSgXGjrwvi108x41OiMAA4u gzn3w1mUywY/2TcN9nbXIt1cuiA+6M4QNXITuESfik4h4X30gZRQgyECLchGVVqc 6swCzhOuIQuB7mBaikBiZWTrtVK9RZrrzpsMNQNzYp3PL1E0bP/R/qX2M5oPaK0L guxiE5TYPlEBmLDNTYxD/ehf4CvuRIFvhIyzB/E5kgGwJ2NoVOrGF3hUc84L1KoD GR10LaARgzNaaGKHkSnFE57BU90zjP46Qp+Vt/8YNkpE9FamqH2/ZXFBl4Vmx4xF tLlHbY37ItqdsFUoQwQIpQVRdysWRGbcet+6mHEpB7Ubc5z6/5R8MoljgBpG+phs +8yj6soIcEJ8nhBwAw1wm9O62BWQqeABOQ0wi6zcryXepWMys9b4Lg5MN7RqlaAO mvH/rczpHgMdkwmnbTaVXb67RlvP81O3XPppMhr1h+2E6KtizoU= =t0Jx -----END PGP SIGNATURE----- --LhDIzfrLhnkATP0NIkiL6jLKIhlDueJIy--