On Tue, Jun 22, 2004 at 04:30:15PM -0600, Scott Ribe wrote:
> > All your queries will be ignored until you complete the transaction,
> > either with a commit or a rollback. I find the message very clear, how
> > do you think it could be reworded to be more clear?
> 
> What's not clear is why I should be told this when the invalid query ended
> with a commit.

Hmm, it only happens when you send the whole lot in a single query
strings. That's not recommended IIRC.

> > In your program, yes. Although I find it interesting that your commit
> > is ignored after the error. Just send it as a seperate query.
> 
> Yes, exactly. I've never seen a commit be ignored like this--believe me I've
> had other erroneous queries, and the connections never got borked like this.

Will, it's definitly repeatable:

$ perl -MPg -e '$db = Pg::connectdb("dbname=kleptog");
$db->exec("begin; select error; commit;");
$db->exec("select 1"); 
print $db->errorMessage;' 
ERROR:  current transaction is aborted, queries ignored until end of
transaction block

> I'll certainly add such code as a fail-safe, but I'd still like to
> understand more fully what has happened. Can I really be 100% sure this
> would keep the connection usable, given that the 1 commit already somehow
> failed to end the transaction block? I can certainly understand that a
> commit submitted by itself might be recognized where for some reason the
> original one was skipped over, but I'd still like to know more about what
> happened.

If you send each query in a seperate request, it'll work. I don't know
if the current behaviour is really a bug...

-- 
Martijn van Oosterhout   <[EMAIL PROTECTED]>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment: pgpiNPNMjIFpv.pgp
Description: PGP signature

Reply via email to