|
|
|
@ -935,34 +935,34 @@ |
|
|
|
|
</indexterm> |
|
|
|
|
<function>random</function> ( <parameter>min</parameter> <type>date</type>, <parameter>max</parameter> <type>date</type> ) |
|
|
|
|
<returnvalue>date</returnvalue> |
|
|
|
|
</para> |
|
|
|
|
<para role="func_signature"> |
|
|
|
|
<function>random</function> ( <parameter>min</parameter> <type>timestamp</type>, <parameter>max</parameter> <type>timestamp</type> ) |
|
|
|
|
<returnvalue>timestamp</returnvalue> |
|
|
|
|
</para> |
|
|
|
|
<para role="func_signature"> |
|
|
|
|
<function>random</function> ( <parameter>min</parameter> <type>timestamptz</type>, <parameter>max</parameter> <type>timestamptz</type> ) |
|
|
|
|
<returnvalue>timestamptz</returnvalue> |
|
|
|
|
</para> |
|
|
|
|
<para> |
|
|
|
|
Returns a random value in the range |
|
|
|
|
<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> |
|
|
|
|
<para> |
|
|
|
|
<literal>random('2000-01-01'::timestamptz, now())</literal> |
|
|
|
|
<returnvalue>2015-09-27 09:11:33.732707+00</returnvalue> |
|
|
|
|
</para></entry> |
|
|
|
|
</row> |
|
|
|
|
</para> |
|
|
|
|
<para role="func_signature"> |
|
|
|
|
<function>random</function> ( <parameter>min</parameter> <type>timestamp</type>, <parameter>max</parameter> <type>timestamp</type> ) |
|
|
|
|
<returnvalue>timestamp</returnvalue> |
|
|
|
|
</para> |
|
|
|
|
<para role="func_signature"> |
|
|
|
|
<function>random</function> ( <parameter>min</parameter> <type>timestamptz</type>, <parameter>max</parameter> <type>timestamptz</type> ) |
|
|
|
|
<returnvalue>timestamptz</returnvalue> |
|
|
|
|
</para> |
|
|
|
|
<para> |
|
|
|
|
Returns a random value in the range |
|
|
|
|
<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> |
|
|
|
|
<para> |
|
|
|
|
<literal>random('2000-01-01'::timestamptz, now())</literal> |
|
|
|
|
<returnvalue>2015-09-27 09:11:33.732707+00</returnvalue> |
|
|
|
|
</para></entry> |
|
|
|
|
</row> |
|
|
|
|
|
|
|
|
|
<row> |
|
|
|
|
<entry role="func_table_entry"><para role="func_signature"> |
|
|
|
|