Thread: Re: [PATCHES] setseed() doc

Re: [PATCHES] setseed() doc

From
Dennis Bjorklund
Date:
Tom Lane skrev:

>>         <entry><literal><function>setseed</function>(<type>dp</type>)</literal></entry>
>>         <entry><type>int</type></entry>
>> -       <entry>set seed for subsequent <literal>random()</literal> calls</entry>
>> +       <entry>set seed for subsequent <literal>random()</literal> calls (value between -1.0 and 1.0)</entry>
>
> Looking at the code, it would appear that the intended range is 0 to 1.

Ok.

What about the return value? The doc didn't say anything about it.

/Dennis

Re: [PATCHES] setseed() doc

From
Tom Lane
Date:
Dennis Bjorklund <db@zigo.dhs.org> writes:
> What about the return value? The doc didn't say anything about it.

AFAICT it's just junk.  It happens to be the input times
MAX_RANDOM_VALUE, but what use is that?  I wonder if we shouldn't
change the function to return VOID ... that option wasn't available
when it was coded originally, else it'd probably have been done that
way.

            regards, tom lane

Re: [PATCHES] setseed() doc

From
Neil Conway
Date:
On Mon, 2006-09-04 at 15:19 -0400, Tom Lane wrote:
> AFAICT it's just junk.  It happens to be the input times
> MAX_RANDOM_VALUE, but what use is that?  I wonder if we shouldn't
> change the function to return VOID

I agree. Given how soon we want to get an 8.2 beta out the door, perhaps
this change would be best postponed to 8.3 (unless there's another
outstanding 8.2 patch that requires initdb?).

-Neil



Re: [PATCHES] setseed() doc

From
Tom Lane
Date:
Neil Conway <neilc@samurai.com> writes:
> On Mon, 2006-09-04 at 15:19 -0400, Tom Lane wrote:
>> AFAICT it's just junk.  It happens to be the input times
>> MAX_RANDOM_VALUE, but what use is that?  I wonder if we shouldn't
>> change the function to return VOID

> I agree. Given how soon we want to get an 8.2 beta out the door, perhaps
> this change would be best postponed to 8.3 (unless there's another
> outstanding 8.2 patch that requires initdb?).

Nothing outstanding at the moment.

Although this is surely a small change, it's also pretty low-priority,
so I'd counsel leaving it for 8.3 rather than trying to cram it in now.
We have more important things to be worrying about ...

            regards, tom lane

Re: [PATCHES] setseed() doc

From
Bruce Momjian
Date:
FYI, Neil has corrected this in CVS HEAD.

---------------------------------------------------------------------------

Tom Lane wrote:
> Neil Conway <neilc@samurai.com> writes:
> > On Mon, 2006-09-04 at 15:19 -0400, Tom Lane wrote:
> >> AFAICT it's just junk.  It happens to be the input times
> >> MAX_RANDOM_VALUE, but what use is that?  I wonder if we shouldn't
> >> change the function to return VOID
>
> > I agree. Given how soon we want to get an 8.2 beta out the door, perhaps
> > this change would be best postponed to 8.3 (unless there's another
> > outstanding 8.2 patch that requires initdb?).
>
> Nothing outstanding at the moment.
>
> Although this is surely a small change, it's also pretty low-priority,
> so I'd counsel leaving it for 8.3 rather than trying to cram it in now.
> We have more important things to be worrying about ...
>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org

--
  Bruce Momjian   bruce@momjian.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +