From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
---|---|
To: | Stephen Touset <stephen(dot)touset+postgresql(at)onelogin(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Implicit transaction not rolling back after error |
Date: | 2012-12-20 23:27:15 |
Message-ID: | 50D39ED3.1060909@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 12/20/2012 03:11 PM, Stephen Touset wrote:
> I'm having difficulty locating the source of a problem our webapp has
> been running into. Multiple Google searches have failed me, so I'm
> hoping someone here can help troubleshoot.
>
>
>
> I also don't encounter the issue if I connect to the running 9.2
> daemon on my development machine either.
>
> Our production webapp also suffers from this problem (which is how we
> noticed it in the first place). It connects to the PostgreSQL daemon
> through a Ruby library (pg) which wraps libpq5. I assumed the only
> commonality between psql and our application was libpq5, so upgraded
> it to a later version (9.2.2) with no luck.
>
> Does anyone know what this might be? Is it a bug? A feature? A
> configuration issue? I'm kind of at a loss at this point.
Well for the psql case check out:
http://www.postgresql.org/docs/9.0/interactive/app-psql.html
"
AUTOCOMMIT
When on (the default), each SQL command is automatically committed upon
successful completion. To postpone commit in this mode, you must enter a
BEGIN or START TRANSACTION SQL command. When off or unset, SQL commands
are not committed until you explicitly issue COMMIT or END. The
autocommit-off mode works by issuing an implicit BEGIN for you, just
before any command that is not already in a transaction block and is not
itself a BEGIN or other transaction-control command, nor a command that
cannot be executed inside a transaction block (such as VACUUM).
Note: In autocommit-off mode, you must explicitly abandon any failed
transaction by entering ABORT or ROLLBACK. Also keep in mind that if you
exit the session without committing, your work will be lost.
Note: The autocommit-on mode is PostgreSQL's traditional behavior, but
autocommit-off is closer to the SQL spec. If you prefer autocommit-off,
you might wish to set it in the system-wide psqlrc file or your
~/.psqlrc file.
"
Not sure about the Ruby case.
>
> Thanks in advance for your help.
>
--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Stephen Touset | 2012-12-20 23:33:21 | Re: Implicit transaction not rolling back after error |
Previous Message | Stephen Touset | 2012-12-20 23:11:59 | Implicit transaction not rolling back after error |