Postgres: detect current transaction level
<p>What's PostgreSQL's equivalent of <a href="https://msdn.microsoft.com/en-us/library/ms187967.aspx" rel="nofollow noreferrer"><code>select @@trancount</code></a>?</p>