X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 88596DA79F for ; Mon, 17 Oct 2005 08:20:27 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 36711-07 for ; Mon, 17 Oct 2005 11:20:24 +0000 (GMT) Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by svr1.postgresql.org (Postfix) with ESMTP id 5ACF9DA833 for ; Mon, 17 Oct 2005 08:20:25 -0300 (ADT) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id BE31C417CA5; Mon, 17 Oct 2005 12:20:20 +0100 (BST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id F1AA915ED9; Mon, 17 Oct 2005 12:17:26 +0100 (BST) Received: from mainbox.archonet.com ([127.0.0.1]) by localhost (mainbox [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 17015-09; Mon, 17 Oct 2005 12:17:24 +0100 (BST) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 3462E15ED5; Mon, 17 Oct 2005 12:17:24 +0100 (BST) Message-ID: <43538843.5000308@archonet.com> Date: Mon, 17 Oct 2005 12:17:23 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051010) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mike Plemmons , pgsql-sql Subject: Re: Question about functions References: <2f8663320510162024j17b4fdb0n4d2b5df1e32d1863@mail.gmail.com> <43535F38.8090202@archonet.com> <2f8663320510170406g55362fe6if76dc339d91b29be@mail.gmail.com> In-Reply-To: <2f8663320510170406g55362fe6if76dc339d91b29be@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.059 required=5 tests=[AWL=0.009, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/180 X-Sequence-Number: 23033 Mike Plemmons wrote: >> >>These are great tips! I will be more specific the next time I post. >>Regarding the ineffiencient query. What do you suggest as a better way? I >>would rather learn proper methods than continue to use improper ones. Just send the query directly from the application - the way you're doing it, the function will have to assemble the query, execute it, fetch all the results and then return them to your application. Of course, if your query altered each row as it fetched them (e.g. to calculate a running total) then this would be a sensible approach. PS - don't forget to CC: the list when replying - that's the convention around here. -- Richard Huxton Archonet Ltd