Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 31EA19F9E22 for ; Tue, 25 Sep 2007 12:53:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 98705-05 for ; Tue, 25 Sep 2007 12:53:54 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by postgresql.org (Postfix) with ESMTP id 957AF9F9E29 for ; Tue, 25 Sep 2007 12:53:53 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id j3so1048883ugf for ; Tue, 25 Sep 2007 08:53:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=07CtxogVUxErHs7db+sKShutGMNsucmT73+2VZGe1GM=; b=l3CWVszqisPQgxmLmxEAEvxiUTuinuCoKNzAyL7KVUw06yAu1xzN9ygmBFktr0GcbkdjDW8WLxO9EePrzjsX9MMmBnpfv8yXzxqXzefI6WKf6mWp/3abA9iqkALMSI9PjuXIvEEXscUjWI7zje1mJyVMsDRKyVSO4biXhnANxRQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=p3JhV2tqnzjwsid4XJukzMfrQDicWEK6E66w8VF/fD/AtrLdrtTiW5B8VIclkExHu+vh/njuYQ9YSyFNTLEhk3hmog+InuP1tZxhbd9vDTLZs1jXyoQLd24/yVD0Bberwuh7rbM50pNLEDaezMAXQz6laX0Iny4XM5QTCaNipWs= Received: by 10.78.175.14 with SMTP id x14mr2528898hue.1190735631827; Tue, 25 Sep 2007 08:53:51 -0700 (PDT) Received: by 10.78.33.6 with HTTP; Tue, 25 Sep 2007 08:53:51 -0700 (PDT) Message-ID: Date: Tue, 25 Sep 2007 11:53:51 -0400 From: "Merlin Moncure" To: "Pavel Stehule" Subject: Re: set returning functions. Cc: "Scott Marlowe" , "Rhys Stewart" , pgsql-general@postgresql.org In-Reply-To: <162867790709250729y2498a494pce31cbd49042ef95@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <189966030709211129t7147b726w25f415489f25b874@mail.gmail.com> <162867790709241509k16bbe691v94c9ef2748fbbba@mail.gmail.com> <189966030709241618p1f104e2ep55a9f8f5725ef90@mail.gmail.com> <162867790709242146m70791358gfe2a9045b6512ece@mail.gmail.com> <162867790709250729y2498a494pce31cbd49042ef95@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/1173 X-Sequence-Number: 121095 On 9/25/07, Pavel Stehule wrote: > 2007/9/25, Scott Marlowe : > > On 9/24/07, Pavel Stehule wrote: > > > 2007/9/25, Rhys Stewart : > > > > yes indeed. thats exactly it scott!!! > > > > > > > > On 9/24/07, Scott Marlowe wrote: > > > > > On 9/24/07, Pavel Stehule wrote: > > > > > > Hello Rhys > > > > > > > > > > > > its not mystery > > > > > > > > > > Yeah, but I think he wanted to be able to make his own function he > > > > > could call like: > > > > > > > > > > select myfunc(10); > > > > > > > > > > > Then you have to use sql language > > > > > > create or replace function mysrf(int) > > > returns setof integer as $$ > > > select i from generate_series(1, $1) g(i); > > > $$ language sql; > > > > Do you HAVE to use sql plsql to get this to work? I thought that all > > pl languages worked like this with pgsql. > > > > if you can call SRF function in normal context (like SELECT srf()), > you have to use SQL language You can also do this in a C function also. you can always wrap your plpgsql function in an sql function and sneak around the problem. That said, it would be extremely nice if pl/pgsql functions could work this way. merlin