Re: [PATCH] Generate random dates/times in a specified range

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Generate random dates/times in a specified range
Дата
Msg-id 907249.1752592242@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Generate random dates/times in a specified range  (Greg Sabino Mullane <htamfids@gmail.com>)
Список pgsql-hackers
Greg Sabino Mullane <htamfids@gmail.com> writes:
> On Mon, Jul 14, 2025 at 3:21 AM Dean Rasheed <dean.a.rasheed@gmail.com>
> wrote:
>> Is it really worth adding a core function for that?

> Yes, I think it is. It is also trivial to get a random int from 50 to 100
> with
> 50 + floor(random() * 51)
> but random(50,100) is so much nicer.

I won't object to adding this for date/timestamp/timestamptz, but
I don't really believe that the time/timetz variants are worth the
code space.  I think the latter two would also have definitional
issues because of the modulo behavior of those types' underlying
arithmetic.

            regards, tom lane



В списке pgsql-hackers по дате отправления: