Here is a new function which could produce an array of numbers with a
controllable array length and duplicated elements in these arrays. I
used it when working with gin index, and I think it would be helpful for
others as well, so here it is.
select * from normal_rand_array(5, 10, 1.8::numeric, 3
It looks useful, for example, it can be used in sorting tests to make them more
interesting. I just have one question. Why are you using SRF_IS_FIRST CALL and
not _PG_init?
Best regards, Stepan Neretin.
Hi Andy
On 08.06.24 08:05, Andy Fan wrote:
> Here is a new function which could produce an array of numbers with a
> controllable array length and duplicated elements in these arrays. I
> used it when working with gin index, and I think it would be helpful for
> others as well, so here it is.
>
>
On Tue, 2 Jul 2024 at 11:18, Jim Jones wrote:
>
> When either minval or maxval exceeds int4 the function cannot be
> executed/found
>
> SELECT * FROM normal_rand_array(5, 10, 8, 42::bigint);
>
> ERROR: function normal_rand_array(integer, integer, integer, bigint)
> does not exist
> LINE 1: SELECT
Dean Rasheed writes:
> My suggestion would be to mirror the signatures of the core random()
> functions more closely, and have this:
>
> 1). rand_array(numvals int, minlen int, maxlen int)
> returns setof float8[]
>
> 2). rand_array(numvals int, minlen int, maxlen int,
>minval
Andy Fan writes:
(just noticed this reply is sent to Jim privately, re-sent it to
public.)
> Hi Jim,
>
>>
>> When either minval or maxval exceeds int4 the function cannot be
>> executed/found
>>
>> SELECT * FROM normal_rand_array(5, 10, 8, 42::bigint);
>>
>> ERROR: function normal_rand_array(i
On Wed, 17 Jul 2024 at 07:29, Andy Fan wrote:
>
> It is just not clear to me how verbose the document should to be, and
> where the document should be, tablefunc.sgml, the comment above the
> function or the places just the code? In many cases you provides above
> or below are just implementation
Dean Rasheed writes:
Hello Dean,
>> I did have some issue to run 'make html', but the
>> error exists before my patch, so I change the document carefully without
>> testing it. do you know how to fix the below error in 'make html'?
>>
>> $/usr/bin/xsltproc --nonet --path . --path . --stringpara
Andy Fan writes:
>>> My suggestion would be to mirror the signatures of the core random()
>>> functions more closely, and have this:
>>>
>>> 1). rand_array(numvals int, minlen int, maxlen int)
>>> returns setof float8[]
>>>
> ..>
>>> 4). rand_array(numvals int, minlen int, maxlen int,
>>>
On Tue, 27 Aug 2024 at 16:43, Andy Fan wrote:
> Andy Fan writes:
>
My suggestion would be to mirror the signatures of the core random()
functions more closely, and have this:
1). rand_array(numvals int, minlen int, maxlen int)
returns setof float8[]
>> ..>
4
Japin Li writes:
> Thanks for updating the patch. Here are some comments.
>
> + if (minlen >= maxlen)
> + ereport(ERROR,
> + (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
> + errmsg("minlen must be greater than
> maxlen.")));
On Wed, 28 Aug 2024 at 12:27, Andy Fan wrote:
> Japin Li writes:
>
>
>> Thanks for updating the patch. Here are some comments.
>>
>> +if (minlen >= maxlen)
>> +ereport(ERROR,
>> +(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
>> +
Japin Li writes:
> On Wed, 28 Aug 2024 at 12:27, Andy Fan wrote:
>> Japin Li writes:
>>
> Nitpick, the minlen is smaller than maxlen, so the maxlen cannot be zero.
>
> After giving it some more thought, it would also be helpful if maxlen is
> equal to minlen.
>
> For example, I want have each r
13 matches
Mail list logo