Re: cursor "" does not exist - Mailing list pgsql-sql

From Andrew Sullivan
Subject Re: cursor "" does not exist
Date
Msg-id 20050616145434.GD30273@phlogiston.dyndns.org
Whole thread Raw
In response to cursor "" does not exist  ("Vsevolod (Simon) Ilyushchenko" <simonf@cshl.edu>)
List 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@crankycanuck.ca
The plural of anecdote is not data.    --Roger Brinner


pgsql-sql by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: SELECT very slow
Next
From: grupos
Date:
Subject: Re: PostgreSQL and Delphi 6