Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e84GAoC73195 for ; Mon, 4 Sep 2000 12:10:50 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id MAA14164; Mon, 4 Sep 2000 12:10:39 -0400 (EDT) To: Andreas Tille cc: PostgreSQL SQL Subject: Re: Order by in stored functions In-reply-to: References: Comments: In-reply-to Andreas Tille message dated "Mon, 04 Sep 2000 07:18:00 +0200" Date: Mon, 04 Sep 2000 12:10:38 -0400 Message-ID: <14161.968083838@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200009/15 Andreas Tille writes: > I've got the following error message: > ERROR: function declared to return varchar returns multiple values in > final retrieve This is a bug that has already been fixed in current sources: the check that makes sure your select produces only one varchar column is mistakenly counting the hidden IdSort column that's needed to sort by. I don't know of any good workaround in 7.0, short of patching the erroneous code. Have you thought about using a view, rather than a function returning set? regards, tom lane