Re: BUG #13849: Need a parameter added similar to "edb_stmt_level_tx"
От | Greg Stark |
---|---|
Тема | Re: BUG #13849: Need a parameter added similar to "edb_stmt_level_tx" |
Дата | |
Msg-id | CAM-w4HNcPXzixfv_SfakTo=z8_4LZMTmd04cVkyDOJopLAh7Kg@mail.gmail.com обсуждение исходный текст |
Ответ на | BUG #13849: Need a parameter added similar to "edb_stmt_level_tx" (skinneda@us.ibm.com) |
Список | pgsql-bugs |
Postgres supports the behaviour you want but the interface is different. Instead you need to create a subtransaction around each statement you want to catch errors in. The way to do this depends on the PL language or language binding you're executing these commands in. In psql you set ON_ERROR_ROLLBACK on. In pl/pgsql you add BEGIN blocks (http://www.postgresql.org/docs/9.5/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING), in plpython and other languages they're mapped to the language's exception handling, see http://www.postgresql.org/docs/current/static/plpython-subtransaction.html EDB's documentation does say "Note: Use edb_stmt_level_tx set to TRUE only when absolutely necessary, as this may cause a negative performance impact." which makes me assume it is just doing the same thing ON_ERROR_ROLLBACK does which is wrapping every statement in a subtransaction. EDB is in the business of adding features to make things compatible with Oracle but Postgres less so. If there was a major advantage to the Oracle interface or it was in the standard then it might be more compelling but just for compatibility with Oracle probably not. Especially since Postgres has had bad experiences with server-side configuration options that change the transaction semantics in the past.
В списке pgsql-bugs по дате отправления: