Damien Clochard <damien@dalibo.info> writes:
> So this adds 5 new variants of the random() function:
> random(min date, max date) returns date
> random(min time, max time) returns time
> random(min time, max time, zone text) returns timetz
> random(min timestamp, max timestamp) returns timestamp
> random(min timestamptz, max timestamptz) returns timestamptz
I'm a little uncomfortable with this proposal, mainly because it
overloads the random() function name to the point where I'm afraid
of "ambiguous function" failures in SQL code that used to be fine.
The traditional way of achieving these results would be something like
select now() + random() * interval '10 days';
and I'm not convinced that the use-case is so large as to justify
adding built-in forms of that.
regards, tom lane