X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B72E652D26 for ; Thu, 14 Jul 2005 22:17:59 -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 50048-05 for ; Fri, 15 Jul 2005 01:17:49 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 2375652D28 for ; Thu, 14 Jul 2005 22:17:49 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.13.1/8.13.1) with ESMTP id j6F1Hk0Q052857 for ; Fri, 15 Jul 2005 01:17:46 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.13.1/8.13.1/Submit) id j6F0tAqS047954 for pgsql-admin@postgresql.org; Fri, 15 Jul 2005 00:55:10 GMT (envelope-from news) From: Ezequiel Tolnay X-Newsgroups: pgsql.admin Subject: Re: functions vs stored procedures Date: Fri, 15 Jul 2005 10:57:04 +1000 Organization: Hub.Org Networking Services Lines: 38 Message-ID: References: <14063.1121347025@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050319 X-Accept-Language: en-au, en-gb, en-us, en, es-ar, es-es In-Reply-To: <14063.1121347025@sss.pgh.pa.us> To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200507/106 X-Sequence-Number: 18162 Thanks for the tip, but unfortunately id didn't address any of my concerns. I alreay use the version 8, and I'm aware of the possibility of using arrays for the results, which allows for some flexibility. But unfortunately arrays are not records, and I'm limited to values of the same types, and cannot refer the values from their column names. To create this function I also have to build the arrays for each result, casting all the values to text in a way that I would be able to convert back to the original value. As it is, the workaround is more complicated than the problem itself, so I think a script droping and recreating all the types and the functions that use them is preferred. żDoes anyone know if there is a reason why PostgreSQL lacks stored procedures? i.e. the type that is executed with the EXECUTE command (e.g. EXECUTE myproc(1, 2, 3)) and capable of returning an arbitrary number of rowsets of arbitrary types. Thanks anyway :o) Ezequiel Tolnay Tom Lane wrote: > Ezequiel Tolnay writes: > >>I just can't get used to the annoyance of having to create a type for >>every single function that returns a rowset. It is frankly cumbersome. > > > Yup. See coming attractions at, eg, > http://developer.postgresql.org/docs/postgres/xfunc-sql.html#XFUNC-OUTPUT-PARAMETERS > http://developer.postgresql.org/docs/postgres/plpgsql-declarations.html#PLPGSQL-DECLARATION-ALIASES > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster >