doc: Improve description of new random(min, max) functions.
authorDean Rasheed <dean.a.rasheed@gmail.com>
Thu, 11 Sep 2025 08:25:47 +0000 (09:25 +0100)
committerDean Rasheed <dean.a.rasheed@gmail.com>
Thu, 11 Sep 2025 08:25:47 +0000 (09:25 +0100)
Mention that the new variants of random(min, max) are affected by
setseed(), like the original functions.

Reported-by: Marcos Pegoraro <marcos@f10.com.br>
Discussion: https://postgr.es/m/CAB-JLwb1=drA3Le6uZXDBi_tCpeS1qm6XQU7dKwac_x91Z4qDg@mail.gmail.com

doc/src/sgml/func/func-datetime.sgml
doc/src/sgml/func/func-math.sgml

index 98dd60aa9a7ecf358d2fa92552ed5e5230d4be8d..a25da4b5175ca4a9586a0fe3c1c2febc9dad49fc 100644 (file)
         Returns a random value in the range
         <parameter>min</parameter> &lt;= x &lt;= <parameter>max</parameter>.
        </para>
+       <para>
+        Note that these functions use the same pseudo-random number generator
+        as the functions listed in <xref linkend="functions-math-random-table"/>,
+        and respond in the same way to calling
+        <link linkend="function-setseed"><function>setseed()</function></link>.
+       </para>
        <para>
         <literal>random('1979-02-08'::date,'2025-07-03'::date)</literal>
         <returnvalue>1983-04-21</returnvalue>
index fd821c0e706773f0afcd1d61903fa5f0dd668c00..9dcf97e7c9e06dd5e620b8335877d5d70be19ae4 100644 (file)
 
       <row>
        <entry role="func_table_entry"><para role="func_signature">
-        <indexterm>
+        <indexterm id="function-setseed">
          <primary>setseed</primary>
         </indexterm>
         <function>setseed</function> ( <type>double precision</type> )