| From: | <david(at)andl(dot)org> |
|---|---|
| To: | |
| Cc: | "'PostgreSQL-development'" <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: About subxact and xact nesting level... |
| Date: | 2016-05-02 14:32:04 |
| Message-ID: | 002b01d1a47f$6757bc60$36073520$@andl.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> From: Thomas Munro [mailto:thomas(dot)munro(at)enterprisedb(dot)com]
> > The file xact.c contains references to sub-transactions (subxact) and
> > transaction nesting level, but no obvious documentation about what
> > these correspond to in SQL. A search shows that plpython supports
> > something called “proper sub transactions”. There are random mentions
> > of subtransactions in the release notes, but nothing substantive that
> > I can find, and nothing about transaction nesting.
> >
> > Any pointers to docs or help to understand much appreciated.
>
> Subtransactions are used to implement SAVEPOINT, and also BEGIN blocks with
> EXCEPTION clauses in plpgsql.
>
> http://www.postgresql.org/docs/9.5/static/sql-savepoint.html
> http://www.postgresql.org/docs/9.5/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
Thanks. I guess that explains the nesting level too. It seems there is an internal API based on:
* BeginInternalSubTransaction
* RollbackAndReleaseCurrentSubTransaction
* ReleaseCurrentSubTransaction
This looks like something I shall need to use. I have the plandl language handler all working, and understanding the transaction environment is turning out to be a major challenge.
Regards
David M Bennett FACS
Andl - A New Database Language - andl.org
--
Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Robert Haas | 2016-05-02 14:32:28 | Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold < |
| Previous Message | Craig Ringer | 2016-05-02 14:27:08 | Re: 9.6 and fsync=off |