Re: [BUGS] BUG #14737: Wrong PL/pgSQL behaviour

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [BUGS] BUG #14737: Wrong PL/pgSQL behaviour
Дата
Msg-id CAKFQuwYc1ZHxDs9vkG5q5=mDF6OLhYqXMyRVSEWpwSHsLh3RDQ@mail.gmail.com
обсуждение исходный текст
Ответ на [BUGS] BUG #14737: Wrong PL/pgSQL behaviour  (frank.von.postgresql.org@familie-gard.de)
Список pgsql-bugs
On Fri, Jul 7, 2017 at 1:49 PM, Frank Gard <frank@familie-gard.de> wrote:
In addition, the result should not differ at all between the two variants of
the function. What makes, semantically, the difference? There's none at all!

     FOR v_anzahl IN 1 .. p_anzahl LOOP
​[...]​

-                wert = p_von + FLOOR( ( 1 + p_bis - p_von ) * RANDOM() )
+                wert = v_zufall

SELECT gs, random()
FROM generate_series(1,10) ser (gs)

The reason this is not a bug is for the same reason the value of random() in the above query is different for every row.

David J.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Frank Gard
Дата:
Сообщение: Re: [BUGS] BUG #14737: Wrong PL/pgSQL behaviour
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] BUG #14737: Wrong PL/pgSQL behaviour