On Wed, 10 Sept 2025 at 14:30, Marcos Pegoraro <[email protected]> wrote:
>
> This patch adds functions func-datetime.sgml but those functions depend on
> setseed function, which is not there.
> Wouldn't it be good to add a note that setseed() will change the result of
> those random functions ?
Agreed. I think something like the attached ought to be sufficient.
Regards,
Dean
diff --git a/doc/src/sgml/func/func-datetime.sgml b/doc/src/sgml/func/func-datetime.sgml
new file mode 100644
index 98dd60a..a25da4b
--- a/doc/src/sgml/func/func-datetime.sgml
+++ b/doc/src/sgml/func/func-datetime.sgml
@@ -949,6 +949,12 @@
<parameter>min</parameter> <= x <= <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>
</para>
diff --git a/doc/src/sgml/func/func-math.sgml b/doc/src/sgml/func/func-math.sgml
new file mode 100644
index fd821c0..9dcf97e
--- a/doc/src/sgml/func/func-math.sgml
+++ b/doc/src/sgml/func/func-math.sgml
@@ -1130,7 +1130,7 @@
<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> )