Обсуждение: BUG #18034: Accept the spelling "+infinity" in datetime input is not accurate

Поиск
Список
Период
Сортировка

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

От
PG Bug reporting form
Дата:
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。


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

От
Bruce Momjian
Дата:
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.



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

От
Tom Lane
Дата:
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



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

От
Bruce Momjian
Дата:
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.



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

От
"yanliang lei"
Дата:
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: >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.

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

От
Vik Fearing
Дата:
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
seniorPostgreSQL 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
typeinput",
 
>   the term 'datetime type' is sufficient for beginners to misunderstand , unless it is noted that 'datetime type' is
ageneral term, representing the following PostgreSQL data types: timestamp [(p)] [without time zone], timestamp [(p)]
withtime 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