Re: Query generates infinite loop - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: Query generates infinite loop
Date
Msg-id CADkLM=fHZezdmrCx0mpB69UemH=frCTkyLVcs4dZ2p1b1hMh4w@mail.gmail.com
Whole thread Raw
In response to Re: Query generates infinite loop  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Query generates infinite loop
List pgsql-hackers
Less sure about that.  ISTM the reason that the previous proposal failed
was that it introduced too much ambiguity about how to resolve
unknown-type arguments.  Wouldn't the same problems arise here?

If I recall, the problem was that the lack of a date-specific generate_series function would result in a date value being coerced to timestamp, and thus adding generate_series(date, date, step) would change behavior of existing code, and that was a POLA violation (among other bad things).

By adding a different function, there is no prior behavior to worry about. So we should be safe with the following signatures doing the right thing, yes?:
    generate_finite_series(start timestamp, step interval, num_elements integer)
    generate_finite_series(start date, step integer, num_elements integer)
    generate_finite_series(start date, step interval year to month, num_elements integer) 

pgsql-hackers by date:

Previous
From: Yura Sokolov
Date:
Subject: Re: BufferAlloc: don't take two simultaneous locks
Next
From: Tom Lane
Date:
Subject: Re: Query generates infinite loop