BUG #18034: Accept the spelling "+infinity" in datetime input is not accurate

Started by PG Bug reporting formover 2 years ago6 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 18034
Logged by: yanliang lei
Email address: msdnchina@163.com
PostgreSQL version: 16beta2
Operating system: RHEL7.9
Description:

in the https://www.postgresql.org/docs/16/release-16.html, there is a new
feature :Accept the spelling "+infinity" in datetime input。
Actually,"in datetime input " is not accurate.
Actually, in the PostgreSQL 16 beta2 edition, the spelling "+infinity" can
be used in the following three datatypes:
1.timestamp [ (p) ] [ without time zone ]
2.timestamp [ (p) ] with time zone
3.date

and the spelling "+infinity" can not be used in the following two
datatypes:
1.time [ (p) ] [ without time zone ]
2.time [ (p) ] with time zone

so ,I think that the follow descirtion is accurate:
Accept the spelling "+infinity" in the following data types:
timestamp [ (p) ] [ without time zone ] 、
timestamp [ (p) ] with time zone、
date datatypes。

#2Bruce Momjian
bruce@momjian.us
In reply to: PG Bug reporting form (#1)
Re: BUG #18034: Accept the spelling "+infinity" in datetime input is not accurate

On Thu, Jul 20, 2023 at 03:25:11PM +0000, PG Bug reporting form wrote:

The following bug has been logged on the website:

Bug reference: 18034
Logged by: yanliang lei
Email address: msdnchina@163.com
PostgreSQL version: 16beta2
Operating system: RHEL7.9
Description:

in the https://www.postgresql.org/docs/16/release-16.html, there is a new
feature :Accept the spelling "+infinity" in datetime input。
Actually,"in datetime input " is not accurate.
Actually, in the PostgreSQL 16 beta2 edition, the spelling "+infinity" can
be used in the following three datatypes:
1.timestamp [ (p) ] [ without time zone ]
2.timestamp [ (p) ] with time zone
3.date

and the spelling "+infinity" can not be used in the following two
datatypes:
1.time [ (p) ] [ without time zone ]
2.time [ (p) ] with time zone

so ,I think that the follow descirtion is accurate:
Accept the spelling "+infinity" in the following data types:
timestamp [ (p) ] [ without time zone ] 、
timestamp [ (p) ] with time zone、
date datatypes。

We call our timestamp type datetime in some cases, e.g.:

https://www.postgresql.org/docs/16/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-FORMAT

timezone_abbreviations (string)

Sets the collection of time zone abbreviations that will be accepted
by the server for datetime input.

I see it in a few other places. Should we rename it other places too?
I thought datetime was just a short-hand for our date-time types.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: BUG #18034: Accept the spelling "+infinity" in datetime input is not accurate

Bruce Momjian <bruce@momjian.us> writes:

in the https://www.postgresql.org/docs/16/release-16.html, there is a new
feature :Accept the spelling "+infinity" in datetime input。
Actually,"in datetime input " is not accurate.
Actually, in the PostgreSQL 16 beta2 edition, the spelling "+infinity" can
be used in the following three datatypes:
1.timestamp [ (p) ] [ without time zone ]
2.timestamp [ (p) ] with time zone
3.date

and the spelling "+infinity" can not be used in the following two
datatypes:
1.time [ (p) ] [ without time zone ]
2.time [ (p) ] with time zone

We call our timestamp type datetime in some cases, e.g.:
...
I see it in a few other places. Should we rename it other places too?
I thought datetime was just a short-hand for our date-time types.

I don't see much reason to change anything here. "Datetime" is not
a perfectly strict classification, eg it might or might not include
"interval" depending on context, and I don't want to try to make
that exact.

A more specific release note entry could be "Accept the spelling
'+infinity' for datetime types that accept infinity"; but I'm not
sure it's worth the extra verbiage.

regards, tom lane

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: BUG #18034: Accept the spelling "+infinity" in datetime input is not accurate

On Wed, Aug 9, 2023 at 10:53:27PM -0400, Tom Lane wrote:

Bruce Momjian <bruce@momjian.us> writes:

We call our timestamp type datetime in some cases, e.g.:
...
I see it in a few other places. Should we rename it other places too?
I thought datetime was just a short-hand for our date-time types.

I don't see much reason to change anything here. "Datetime" is not
a perfectly strict classification, eg it might or might not include
"interval" depending on context, and I don't want to try to make
that exact.

A more specific release note entry could be "Accept the spelling
'+infinity' for datetime types that accept infinity"; but I'm not
sure it's worth the extra verbiage.

Yeah, that was my analysis too.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.

#5yanliang lei
msdnchina@163.com
In reply to: Bruce Momjian (#4)
Re:Re: BUG #18034: Accept the spelling "+infinity" in datetime input is not accurate

Dear everyone,
I raise this question based on the following considerations:
1. Make PostgreSQL easier for beginners to learn;
2. PostgreSQL is a database software product rather than a database software project. A product means being more user-friendly, precise, and reducing the likelihood of misunderstandings。

The datetime type may make beginners think that there is a datetime data type in the PostgreSQL database. Although senior PostgreSQL professionals know that there is no datetime data type, the datetime type is enough to make beginners misunderstand.
However, When they saw that the ReleaseNote in PostgreSQL 16 recorded "Accept the spelling"+infinity "in datetime type input",
the term 'datetime type' is sufficient for beginners to misunderstand , unless it is noted that 'datetime type' is a general term, representing the following PostgreSQL data types: timestamp [(p)] [without time zone], timestamp [(p)] with time zone, date。

I am not nitpicking ,I hope that: PostgreSQL database software products can become more perfect and accurate。
Thanks a lot!

At 2023-08-10 19:25:51, "Bruce Momjian" <bruce@momjian.us> wrote:

Show quoted text

On Wed, Aug 9, 2023 at 10:53:27PM -0400, Tom Lane wrote:

Bruce Momjian <bruce@momjian.us> writes:

We call our timestamp type datetime in some cases, e.g.:
...
I see it in a few other places. Should we rename it other places too?
I thought datetime was just a short-hand for our date-time types.

I don't see much reason to change anything here. "Datetime" is not
a perfectly strict classification, eg it might or might not include
"interval" depending on context, and I don't want to try to make
that exact.

A more specific release note entry could be "Accept the spelling
'+infinity' for datetime types that accept infinity"; but I'm not
sure it's worth the extra verbiage.

Yeah, that was my analysis too.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.

#6Vik Fearing
vik@postgresfriends.org
In reply to: yanliang lei (#5)
Re: BUG #18034: Accept the spelling "+infinity" in datetime input is not accurate

On 8/18/23 15:57, yanliang lei wrote:

Dear everyone,
I raise this question based on the following considerations:
1. Make PostgreSQL easier for beginners to learn;
2. PostgreSQL is a database software product rather than a database software project. A product means being more user-friendly, precise, and reducing the likelihood of misunderstandings。

The datetime type may make beginners think that there is a datetime data type in the PostgreSQL database. Although senior PostgreSQL professionals know that there is no datetime data type, the datetime type is enough to make beginners misunderstand.
However, When they saw that the ReleaseNote in PostgreSQL 16 recorded "Accept the spelling"+infinity "in datetime type input",
the term 'datetime type' is sufficient for beginners to misunderstand , unless it is noted that 'datetime type' is a general term, representing the following PostgreSQL data types: timestamp [(p)] [without time zone], timestamp [(p)] with time zone, date。

I am not nitpicking ,I hope that: PostgreSQL database software products can become more perfect and accurate。
Thanks a lot!

On the other hand, the standard talks about datetime types as a
collection of dates, times, timestamps, and intervals; and there is no
type called "datetime" in the standard. We are just doing the same
thing here.
--
Vik Fearing