Re: Problem with Function

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Eduardo Muñoz <eduardomc_79(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem with Function
Date: 2006-03-02 21:38:59
Message-ID: 20060302213859.GA9909@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 02, 2006 at 03:18:14PM -0600, Eduardo Muoz wrote:
> Hi, I'm new with pgSQL and I'm not sure why, but I
> keep getting the same error. I want to call a function
> that returns a cursor and I keep getting the following
> exception:
>
> org.postgresql.util.PSQLException: ERROR: cursor
> "<unnamed portal 1>" does not exist

Cursors are closed at the end of the transaction that created them.
Is your JDBC code calling the function and using the cursor in the
same transaction? I'd guess that autocommit is enabled, so unless
you explicitly start a transaction then each command has its own
transaction.

> where nombreusuario = quote_literal($1);

You shouldn't need quote_literal here since you're not building a
string for EXECUTE. In fact, not only is it unecessary but it'll
probably cause the query not to match what you were expecting.

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Noel Faux 2006-03-02 22:56:40 Re: Data corruption zero a file - help!!
Previous Message Eduardo Muñoz 2006-03-02 21:18:14 Problem with Function