X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E98909DCA5B for ; Tue, 20 Dec 2005 11:05:19 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97305-03 for ; Tue, 20 Dec 2005 11:05:23 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtpout.eastlink.ca (smtpout.eastlink.ca [24.222.0.30]) by postgresql.org (Postfix) with ESMTP id 02A9E9DCA55 for ; Tue, 20 Dec 2005 11:05:16 -0400 (AST) Received: from ip01.eastlink.ca ([24.222.10.5]) by mta01.eastlink.ca (Sun Java System Messaging Server 6.2-4.03 (built Sep 22 2005)) with ESMTP id <0IRS00CLPXWST8T1@mta01.eastlink.ca> for pgsql-sql@postgresql.org; Tue, 20 Dec 2005 11:05:16 -0400 (AST) Received: from blk-137-99-147.eastlink.ca (HELO tickletrunk.engtech.eng) ([24.137.99.147]) by ip01.eastlink.ca with ESMTP; Tue, 20 Dec 2005 11:04:28 -0400 Date: Tue, 20 Dec 2005 11:04:26 -0400 From: Michael Burke Subject: Re: Sub-query as function argument In-reply-to: To: pgsql-sql@postgresql.org Message-id: <200512201104.27152.michael@engtech.ca> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Content-disposition: inline X-BrightmailFiltered: true X-Brightmail-Tracker: AAAAAA== References: <200512200942.51624.michael@engtech.ca> User-Agent: KMail/1.8.3 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.06 required=5 tests=[AWL=0.060] X-Spam-Score: 0.06 X-Spam-Level: X-Archive-Number: 200512/177 X-Sequence-Number: 23719 On December 20, 2005 10:52 am, Jaime Casanova wrote: > have you tried? Yes: => SELECT my_func('Sample', NULL, SELECT MIN(year) FROM audio); ERROR: syntax error at or near "SELECT" at character 32 PostgreSQL 7.4.9, myfunc is pl/pgsql. Just found a working method, though: => SELECT my_func('Sample', NULL, MIN(year)) FROM audio [ WHERE ... ]; -- Michael Burke michael@engtech.ca