Re: cursor "<unnamed portal 1>" does not exist

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: cursor "<unnamed portal 1>" does not exist
Date: 2005-06-16 14:54:34
Message-ID: 20050616145434.GD30273@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Jun 15, 2005 at 06:45:56PM -0400, Vsevolod (Simon) Ilyushchenko wrote:
> While those that fail look like this:
>
> Request select * from material_pkg.ListCautions_fcn($1,$2) as result B
> Response result <unnamed portal 1>C SELECT
>
> Note that the successful ones contain strings "S_1" and "BEGIN", and the
> failed ones do not. However, there also are successful queries without
> these strings, but they are not "select *" queries. Eg,

> I have a feeling it's some idiosyncrasy that I'm not familiar with. Does
> "BEGIN" refer to the beginning of a trasaction?

Yes. A transaction looks like this:

BEGIN;
SQL1;
SQL2;
COMMIT;

But it also looks like this:

SQL3;

because in PostgreSQL, everything is always automatically in a
transaction, and a bald SQL statement is just a transaction one
statement long. With autocommit off, I think what you get is no
COMMIT, but you still get the bald transaction.

What you really need is to make sure you're starting a
multi-statement transaction every time.

A

--
Andrew Sullivan | ajs(at)crankycanuck(dot)ca
The plural of anecdote is not data.
--Roger Brinner

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message grupos 2005-06-16 15:04:06 Re: [SQL] PostgreSQL and Delphi 6
Previous Message Thomas Kellerer 2005-06-16 14:45:35 Re: SELECT very slow