Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 5EF28632845 for ; Sat, 1 May 2010 05:55:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 82220-02 for ; Sat, 1 May 2010 08:55:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moon.antora.ru (moon.antora.ru [89.111.189.180]) by mail.postgresql.org (Postfix) with ESMTP id 9AE6A632292 for ; Sat, 1 May 2010 05:55:25 -0300 (ADT) Envelope-to: pgsql-sql@postgresql.org Received: from moon.inner.space ([10.1.1.5] helo=moon.antora.ru) by moon.antora.ru with esmtp (Exim 4.67) (envelope-from ) id 1O88Tq-0004K1-6i for pgsql-sql@postgresql.org; Sat, 01 May 2010 12:55:22 +0400 Received: from [192.168.1.6] [178.34.182.145] by moon.antora.ru (Axigen) with (DHE-RSA-AES256-SHA encrypted) ESMTPSA id 0D2BFB; Sat, 1 May 2010 12:55:21 +0400 Message-ID: <4BDBEC79.9080008@bankir.ru> Date: Sat, 01 May 2010 12:55:21 +0400 From: silly sad User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20100111 Thunderbird/3.0 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: LIMIT problem References: <4BDAD20A.1090503@bankir.ru> <4BDAD39C.2090207@itech7.com> In-Reply-To: <4BDAD39C.2090207@itech7.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.8 tagged_above=-5 required=5 tests=BAYES_50=0.8 X-Spam-Level: X-Archive-Number: 201005/1 X-Sequence-Number: 34049 On 04/30/10 16:57, Nilesh Govindarajan wrote: > On 04/30/2010 06:20 PM, silly sad wrote: >> suppose i request >> >> SELECT foo(t.x) FROM t LIMIT 1; >> >> Whither it DEFINED how many times foo() will be executed? >> >> May anyone rely on it? >> Or we have to avoid this non SQLish trick? >> > > It will execute foo only once, and give only one row out of the n rows > it returns. If I'm wrong please correct me. I did not asked how many times foo() would be executed.