Re: LIMIT problem
| От | silly sad |
|---|---|
| Тема | Re: LIMIT problem |
| Дата | |
| Msg-id | 4BDBEEC7.5030405@bankir.ru обсуждение исходный текст |
| Ответ на | Re: LIMIT problem (Jasen Betts <jasen@xnet.co.nz>) |
| Список | pgsql-sql |
On 05/01/10 03:58, Jasen Betts wrote: > On 2010-04-30, silly sad<sad@bankir.ru> wrote: >> suppose i request >> >> SELECT foo(t.x) FROM t LIMIT 1; >> >> Whither it DEFINED how many times foo() will be executed? > > foo will be executed repeatedly until it returns a result or all the > rows in t are exhausted. > >> May anyone rely on it? > > not sure > >> Or we have to avoid this non SQLish trick? > > > This will execute it once (or not at all where t has no rows) > > SELECT foo(x) FROM (SELECT x FROM t LIMIT 1) as bar; > this subselect "isolation" looks like a safe way. Unlike LIMITed select looks unpredictable to me. Thanx for assistance :)
В списке pgsql-sql по дате отправления: