X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 76829D1B901 for ; Sun, 22 Feb 2004 17:11:42 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 18892-03 for ; Sun, 22 Feb 2004 13:11:39 -0400 (AST) Received: from internet.potentialtech.com (h-66-167-251-6.PHLAPAFG.covad.net [66.167.251.6]) by svr1.postgresql.org (Postfix) with ESMTP id 82BFED1B90C for ; Sun, 22 Feb 2004 13:11:38 -0400 (AST) Received: from potentialtech.com (pa-plum1c-102.pit.adelphia.net [24.53.179.102]) by internet.potentialtech.com (Postfix) with ESMTP id 7702A69A71; Sun, 22 Feb 2004 12:11:37 -0500 (EST) Message-ID: <4038E2C6.6020108@potentialtech.com> Date: Sun, 22 Feb 2004 12:11:34 -0500 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031005 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Cornelia Boenigk Cc: pgsql-general@postgresql.org Subject: Re: problem with cursur within a scriptfile References: <296d84e62fc40fc6e1938b7086259dac@biglumber.com> <00f201c3f964$2d68baf0$0201a8c0@zwerg2000> In-Reply-To: <00f201c3f964$2d68baf0$0201a8c0@zwerg2000> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/1009 X-Sequence-Number: 57720 Cornelia Boenigk wrote: > Hi everybody > > I defined a function returning refcursor. > > CREATE FUNCTION cursorname (refcursor, character varying, character > varying) RETURNS refcursor ... > which does a select with username and serachphrase. > > If I call > > BEGIN; > SELECT cursorname(`test`,`username`,`searchphrase`); > MOVE 10 in test; > FETCH 25 from test; > COMMIT; > > inside psql everything works well. If I put this code into a > scriptfile and call it, I get the following errormessage: > > cannot handle multiple result groups > > Why? What does this mean? > > I use a webserver which has 'one' persistent connection to the > database. Executing the script the connection breaks. Trying to do a > rollback the database returns that there is no transaction in > progress. > > Any help is welcome Sure seems like whatever database client you're using doesn't really support transactions. Is is possible that each SQL command is being issued seperatly to the backend in "unchained" mode? You might want to provide the list with some details on the Postgres client you're using and how you're using it. Then, someone with experience with that client can make a specific suggestion. -- Bill Moran Potential Technologies http://www.potentialtech.com