NO. I wrote that to rule out the objection that PostrgeSQL is getting the right answer because random() is only being computed once per statement. I naturally DO expect random() to run every time it is called. What I wrote is a formality for those thinking ahead about what else could be happening.
On Thu, Jan 18, 2018 at 10:46 PM, Simon Slavin <[email protected]> wrote: > On 19 Jan 2018, at 5:04am, petern <[email protected]> wrote: > > > WITH flips(s) AS (VALUES (random()), (random()), (random())) > > SELECT * FROM flips; > > > > s > > 0.760850821621716 > > 0.9941047639586031 > > 0.48273737309500575 > > Are you expecting the three values to be the same ? What about > > INSERT INTO MyTable VAKUES (random(), random(), random()) > > ? Would you expect those three values to be the same ? > > If you think of random() as an external function, do you think of it as > marked SQLITE_DETERMINISTIC as defined in the following page ? > > <https://sqlite.org/c3ref/create_function.html> > > Simon. > _______________________________________________ > sqlite-users mailing list > [email protected] > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

