From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: cursor "<unnamed portal 1>" does not exist
Date: Thu, 16 Jun 2005 10:54:34 -0400
Message-ID: <20050616145434.GD30273@phlogiston.dyndns.org> (raw)
In-Reply-To: <42B0AFA4.202@cshl.edu>
References: <42B0AFA4.202@cshl.edu>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ajs@crankycanuck.ca
Subject: Re: cursor "<unnamed portal 1>" does not exist
In-Reply-To: <20050616145434.GD30273@phlogiston.dyndns.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox