Re: [GENERAL] Random multiple times

2011-09-22 Thread Oliver Kohll - Mailing Lists
Many thanks both, those solutions are great and have gone in my wiki for future ref. Regards Oliver On 21 Sep 2011, at 21:56, Szymon Guz wrote: > > > >> Short answer is: yes. More information you can find > >> here > >> http://simononsoftware.com/problem-with-random-in-postgresql-subselect/ >

Re: [GENERAL] Random multiple times

2011-09-21 Thread Szymon Guz
On 21 September 2011 20:58, Merlin Moncure wrote: > On Wed, Sep 21, 2011 at 5:43 AM, Szymon Guz wrote: > > > > > > On 21 September 2011 11:18, Szymon Guz wrote: > >> > >> > >> On 21 September 2011 10:51, Oliver Kohll - Mailing Lists > >> wrote: > >>> > >>> Hi, > >>> > >>> I understand random()

Re: [GENERAL] Random multiple times

2011-09-21 Thread Merlin Moncure
On Wed, Sep 21, 2011 at 5:43 AM, Szymon Guz wrote: > > > On 21 September 2011 11:18, Szymon Guz wrote: >> >> >> On 21 September 2011 10:51, Oliver Kohll - Mailing Lists >> wrote: >>> >>> Hi, >>> >>> I understand random() is a volatile function and runs multiple times for >>> multiple rows return

Re: [GENERAL] Random multiple times

2011-09-21 Thread Szymon Guz
On 21 September 2011 11:18, Szymon Guz wrote: > > > On 21 September 2011 10:51, Oliver Kohll - Mailing Lists < > oliver.li...@gtwm.co.uk> wrote: > >> Hi, >> >> I understand random() is a volatile function and runs multiple times for >> multiple rows returned by a SELECT, however is there a way of

Re: [GENERAL] Random multiple times

2011-09-21 Thread Daniel Baktiar
what i read is different from what you expect, what actually happened: it didn't return the same digit each time. instead, it returned one digit once only, as i would expect that the trunc(random() * 9 + 1)::text to be evaluated once only. the next the query did was replacing the all the digit with

Re: [GENERAL] Random multiple times

2011-09-21 Thread Szymon Guz
On 21 September 2011 10:51, Oliver Kohll - Mailing Lists < oliver.li...@gtwm.co.uk> wrote: > Hi, > > I understand random() is a volatile function and runs multiple times for > multiple rows returned by a SELECT, however is there a way of getting it to > run multiple times *within* another function

[GENERAL] Random multiple times

2011-09-21 Thread Oliver Kohll - Mailing Lists
Hi, I understand random() is a volatile function and runs multiple times for multiple rows returned by a SELECT, however is there a way of getting it to run multiple times *within* another function call and in the same row. i.e. something like select regexp_replace('+1 555 555 555', E'\\d', tr