X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6387152836 for ; Thu, 16 Jun 2005 11:54:44 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63027-08 for ; Thu, 16 Jun 2005 14:54:34 +0000 (GMT) Received: from smtp102.rog.mail.re2.yahoo.com (smtp102.rog.mail.re2.yahoo.com [206.190.36.80]) by svr1.postgresql.org (Postfix) with SMTP id 474FE5282F for ; Thu, 16 Jun 2005 11:54:32 -0300 (ADT) Received: (qmail 93069 invoked from network); 16 Jun 2005 14:54:37 -0000 Received: from unknown (HELO phlogiston.dydns.org) (a.sullivan@rogers.com@216.75.167.195 with login) by smtp102.rog.mail.re2.yahoo.com with SMTP; 16 Jun 2005 14:54:37 -0000 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 3E3663F9D; Thu, 16 Jun 2005 10:54:34 -0400 (EDT) Date: Thu, 16 Jun 2005 10:54:34 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: cursor "" does not exist Message-ID: <20050616145434.GD30273@phlogiston.dyndns.org> References: <42B0AFA4.202@cshl.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42B0AFA4.202@cshl.edu> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.043 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200506/198 X-Sequence-Number: 21799 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 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