Re: [pgsql-patches] [HACKERS] [PATCHES] setseed() doc

2007-01-20 Thread Bruce Momjian

FYI, Neil has corrected this in CVS HEAD.

---

Tom Lane wrote:
 Neil Conway [EMAIL PROTECTED] 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   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

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

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] [PATCHES] setseed() doc

2006-09-20 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] 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


[PATCHES] setseed() doc

2006-09-04 Thread Dennis Bjorklund

The doc doesn't state in what range the argument to setseed() should be.

Some tests suggest that only values in the range -1.0 to 1.0 work as a 
seed and values outside of that give the same sequence of random numbers.


I've attached a trivial one line patch (this is the patch list after 
all), but feel free to document it in any way that is appropriate.


setseed() also return an integer, but I have no clue of what it is. The 
doc doesn't say anything about it.


The doc say that some functions here depend on the libc that is used, 
but such things as the range of the argument and what the return value 
is should be in the doc, shouldn't it?


/Dennis
Index: doc/src/sgml/func.sgml
===
RCS file: /cvsroot/pgsql/doc/src/sgml/func.sgml,v
retrieving revision 1.332
diff -u -r1.332 func.sgml
--- doc/src/sgml/func.sgml  22 Aug 2006 00:49:19 -  1.332
+++ doc/src/sgml/func.sgml  4 Sep 2006 18:18:26 -
@@ -795,7 +795,7 @@
   row

entryliteralfunctionsetseed/function(typedp/type)/literal/entry
entrytypeint/type/entry
-   entryset seed for subsequent literalrandom()/literal calls/entry
+   entryset seed for subsequent literalrandom()/literal calls (value 
between -1.0 and 1.0)/entry
entryliteralsetseed(0.54823)/literal/entry
entryliteral1177314959/literal/entry
   /row

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [PATCHES] setseed() doc

2006-09-04 Thread Dennis Bjorklund

Tom Lane skrev:



entryliteralfunctionsetseed/function(typedp/type)/literal/entry
entrytypeint/type/entry
-   entryset seed for subsequent literalrandom()/literal calls/entry
+   entryset seed for subsequent literalrandom()/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

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [PATCHES] setseed() doc

2006-09-04 Thread Tom Lane
Dennis Bjorklund [EMAIL PROTECTED] 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

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [PATCHES] setseed() doc

2006-09-04 Thread Bruce Momjian
Tom Lane wrote:
 Dennis Bjorklund [EMAIL PROTECTED] writes:
  
  entryliteralfunctionsetseed/function(typedp/type)/literal/entry
  entrytypeint/type/entry
  -   entryset seed for subsequent literalrandom()/literal 
  calls/entry
  +   entryset seed for subsequent literalrandom()/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.

Docs updated.

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: doc/src/sgml/func.sgml
===
RCS file: /cvsroot/pgsql/doc/src/sgml/func.sgml,v
retrieving revision 1.332
diff -c -c -r1.332 func.sgml
*** doc/src/sgml/func.sgml	22 Aug 2006 00:49:19 -	1.332
--- doc/src/sgml/func.sgml	4 Sep 2006 21:45:15 -
***
*** 795,801 
row
 entryliteralfunctionsetseed/function(typedp/type)/literal/entry
 entrytypeint/type/entry
!entryset seed for subsequent literalrandom()/literal calls/entry
 entryliteralsetseed(0.54823)/literal/entry
 entryliteral1177314959/literal/entry
/row
--- 795,801 
row
 entryliteralfunctionsetseed/function(typedp/type)/literal/entry
 entrytypeint/type/entry
!entryset seed for subsequent literalrandom()/literal calls (value between 0 and 1.0)/entry
 entryliteralsetseed(0.54823)/literal/entry
 entryliteral1177314959/literal/entry
/row

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq