@@TRANCOUNT ?

Started by İlyas Derseabout 6 years ago3 messagesgeneral
Jump to latest
#1İlyas Derse
ilyasderse@gmail.com

What's Prostgres' equivalent of select @@trancount
<https://msdn.microsoft.com/en-us/library/ms187967.aspx&gt;? Do you have an
idea ?

#2Rob Sargent
robjsargent@gmail.com
In reply to: İlyas Derse (#1)
Re: @@TRANCOUNT ?

1 ;)

Show quoted text

On Jan 22, 2020, at 5:59 AM, İlyas Derse <ilyasderse@gmail.com> wrote:


What's Prostgres' equivalent of select @@trancount? Do you have an idea ?

#3Justin
zzzzz.graf@gmail.com
In reply to: İlyas Derse (#1)
Re: @@TRANCOUNT ?

Postgresql does not support Transaction in the same way mssql, it does
support nesting transactions in a limited way from version 11+
https://docs.microsoft.com/en-us/sql/t-sql/functions/trancount-transact-sql?view=sql-server-ver15
https://www.postgresql.org/docs/current/sql-begin.html
https://wiki.postgresql.org/wiki/Autonomous_subtransactions
https://www.postgresql.org/docs/11/sql-createprocedure.html
https://severalnines.com/database-blog/overview-new-stored-procedures-postgresql-11

From version 11 and up we have Procedures it supports commit and rollback
transaction inside a PROCEDURE and must be called with CALL, there are no
savepoints or transaction naming support...

There are work around this problem using PlPython, or FDW to callback to
postgresql creating a new session to create independent Transactions..

On Wed, Jan 22, 2020 at 7:59 AM İlyas Derse <ilyasderse@gmail.com> wrote:

Show quoted text

What's Prostgres' equivalent of select @@trancount
<https://msdn.microsoft.com/en-us/library/ms187967.aspx&gt;? Do you have an
idea ?