Re: problem with cursur within a scriptfile

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Cornelia Boenigk <poppcorn(at)cornelia-boenigk(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: problem with cursur within a scriptfile
Date: 2004-02-22 17:11:34
Message-ID: 4038E2C6.6020108@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Costa 2004-02-22 20:52:25 Re: phpBB 2.2 and PostgreSQL support
Previous Message Cornelia Boenigk 2004-02-22 16:50:55 problem with cursur within a scriptfile

Browse pgsql-interfaces by date

  From Date Subject
Next Message Gyorgy Molnar 2004-02-22 21:11:16 System tuning
Previous Message Cornelia Boenigk 2004-02-22 16:50:55 problem with cursur within a scriptfile