Greg Sabino Mullane writes:
> On Mon, Jul 14, 2025 at 3:21 AM Dean Rasheed
> 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'
On Mon, Jul 14, 2025 at 3:21 AM Dean Rasheed
wrote:
> But it's completely trivial to emulate random(min_date, max_date), just by
> doing
>
> min_date + random(0, max_date - min_date)
>
> Is it really worth adding a core function for that?
>
Yes, I think it is. It is also trivial to get a rando
On Tue, 15 Jul 2025 at 04:49, Robert Treat wrote:
>
> On Mon, Jul 14, 2025 at 3:21 AM Dean Rasheed wrote:
> >
> > But it's completely trivial to emulate random(min_date, max_date), just by
> > doing
> >
> > min_date + random(0, max_date - min_date)
> >
> > Is it really worth adding a core func
On Mon, Jul 14, 2025 at 3:21 AM Dean Rasheed wrote:
> On Sat, 12 Jul 2025 at 16:15, Greg Sabino Mullane wrote:
> >
> > I like the idea, especially the date variant. Unlike Tom, I'm not
> > particularly concerned about breakage of existing scripts, as
> > most already are working just fine with r
On Sat, 12 Jul 2025 at 16:15, Greg Sabino Mullane wrote:
>
> I like the idea, especially the date variant. Unlike Tom, I'm not
> particularly concerned about breakage of existing scripts, as
> most already are working just fine with raw numbers and I don't see this
> patch breaking them.
>
> In
Patch review
OVERALL:
I like the idea, especially the date variant. Unlike Tom, I'm not
particularly concerned about breakage of existing scripts, as
most already are working just fine with raw numbers and I don't see this
patch breaking them.
In a selfish vein, I would use the "date" and timest
Le 10.07.2025 00:14, Tom Lane a écrit :
Damien Clochard 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,
Damien Clochard 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
>
Hello,
As I am involved in the PostgreSQL Anonymizer extension, I found that
the random(min,max) functions introduced recently are very useful to
generate synthetic data or define a masking policy.
I decided to submit a similar set of functions for random dates and
times.
So this adds 5 ne