Re: Implicit transaction not rolling back after error
От | Adrian Klaver |
---|---|
Тема | Re: Implicit transaction not rolling back after error |
Дата | |
Msg-id | 50D39ED3.1060909@gmail.com обсуждение исходный текст |
Ответ на | Implicit transaction not rolling back after error (Stephen Touset <stephen.touset+postgresql@onelogin.com>) |
Ответы |
Re: Implicit transaction not rolling back after error
Re: Implicit transaction not rolling back after error |
Список | 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.klaver@gmail.com
В списке pgsql-general по дате отправления: