Received: from maia.hub.org (maia-1.hub.org [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id BCAEC6334D8 for ; Fri, 30 Apr 2010 10:26:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 43206-10 for ; Fri, 30 Apr 2010 13:25:45 +0000 (UTC) X-Greylist: delayed 00:23:07.894546 by SQLgrey-1.7.6 Received: from mail-pz0-f199.google.com (mail-pz0-f199.google.com [209.85.222.199]) by mail.postgresql.org (Postfix) with ESMTP id 5B9E8633256 for ; Fri, 30 Apr 2010 10:25:53 -0300 (ADT) Received: by pzk37 with SMTP id 37so104149pzk.29 for ; Fri, 30 Apr 2010 06:25:51 -0700 (PDT) Received: by 10.115.117.6 with SMTP id u6mr7724746wam.191.1272632226537; Fri, 30 Apr 2010 05:57:06 -0700 (PDT) Received: from [192.168.1.254] ([121.246.205.20]) by mx.google.com with ESMTPS id 21sm1856856pzk.8.2010.04.30.05.57.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 30 Apr 2010 05:57:05 -0700 (PDT) Message-ID: <4BDAD39C.2090207@itech7.com> Date: Fri, 30 Apr 2010 18:27:00 +0530 From: Nilesh Govindarajan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Shredder/3.0.4 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: LIMIT problem References: <4BDAD20A.1090503@bankir.ru> In-Reply-To: <4BDAD20A.1090503@bankir.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201004/120 X-Sequence-Number: 34047 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. -- Nilesh Govindarajan Site & Server Administrator www.itech7.com मेरा भारत महान ! मम भारत: महत्तम भवतु !