Re: Feature request: Improve allowed values for generate series - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Feature request: Improve allowed values for generate series
Date
Msg-id CAKFQuwYS6UZTOBD6mXptTn_8dvpDQ2KpM1s94UcraX6XEtfUxw@mail.gmail.com
Whole thread Raw
In response to Feature request: Improve allowed values for generate series  (Eugen Konkov <kes-kes@yandex.ru>)
List pgsql-hackers
On Wed, Nov 11, 2020 at 7:54 PM Eugen Konkov <kes-kes@yandex.ru> wrote:
Hello David,

I have a table with services, each service have a period. After which service is auto renewal

Services also could be one-time. At this case its interval is '00:00:00'

In which case the concept of interval is undefined - there is no meaningful "second date" here, just the one expiration date - yet you are choosing to keep it in order to introduce an artificial similarity between one-time service and auto-renewal service.  This use case isn't convincing for me.  Writing the one-time service query without generate_series leaves out extraneous stuff that isn't important, which I would recommend even if generate_series were to work as described.

If you are going to introduce code-specific stuff to make this work just write: SELECT * FROM generate_series( '2020-11-09', '2020-11-09', INTERVAL '1000 years' );  It is just as much a construction of code as the other.

David J.

pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: logical streaming of xacts via test_decoding is broken
Next
From: Amit Kapila
Date:
Subject: Re: logical streaming of xacts via test_decoding is broken