Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 39352475EA8 for ; Mon, 14 Oct 2002 23:36:30 -0400 (EDT) Received: from gatekeeper.gmanetwork.com (unknown [202.61.78.68]) by postgresql.org (Postfix) with ESMTP id 23D20475E3E for ; Mon, 14 Oct 2002 23:36:24 -0400 (EDT) Received: from gmanewmedia.com (mailhost.gmanmi.tv [192.168.6.3]) by gatekeeper.gmanetwork.com (8.11.0/8.11.0) with ESMTP id g9F3aOK28519; Tue, 15 Oct 2002 11:36:24 +0800 Received: from mel ([192.168.6.27]) by gmanewmedia.com (8.11.1/) with SMTP id g9F3Elv76903; Tue, 15 Oct 2002 11:14:48 +0800 (PHT) (envelope-from mel@gmanmi.tv) X-RAV-Anti-Virus: This e-mail has been scanned for viruses on host: gmanewmedia.com Reply-To: From: "Mel Jamero" To: "'Bhuvan A'" , Subject: Re: function in place of sub-select Date: Tue, 15 Oct 2002 11:47:45 +0800 Message-ID: <001b01c273fd$a7749230$1b06a8c0@mel> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/91 X-Sequence-Number: 5949 Hi Bhuvan! One way might be to create a C (or C++) program that emulates your my_func function. We've tried doing this and did some benchmarks that show that the system works quite faster when you take out the stored procedures/functions and "translate" them into C programs. Regards, Mel Jamero -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Bhuvan A Sent: Saturday, October 12, 2002 7:52 PM To: pgsql-admin@postgresql.org Subject: [ADMIN] function in place of sub-select Hi, I am using postgresql 7.2 on RHL7.3. I know that we cannot return a record or multiple values from a plpgsql procedure unless otherwise it is a triggered procedure. But i have a need to use a function in place of sub-select, something like select * from my_table where field1 in (select my_func()); my_func() returns a value of type text. I am literally parsing the values in my_func() to return the value, in the format acceptable by IN operator. Something like, "'value1', 'value2'". But it has been interpreted as it is instead of 'value1' and 'value2' seperately and resulting in 0 record. Again, a view instead of function in a sub-select donot help in my case, since i have lot of processing involved in the function. How do i accompanise it in function? Or whats the other way? TIA. regards, bhuvaneswaran ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org