pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@dcc.uchile.cl>
Cc: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Barry Lind <blind@xythos.com>
Cc: simon@2ndquadrant.com
Cc: Patches <pgsql-patches@postgresql.org>
Subject: Re: Nested transactions
Date: Fri, 18 Jun 2004 11:38:10 -0400
Message-ID: <20920.1087573090@sss.pgh.pa.us> (raw)
In-Reply-To: <20040617020117.GC5925@dcc.uchile.cl>
References: <200406170136.i5H1aX727064@candle.pha.pa.us>
	<40D0FB7C.8030309@familyhealth.com.au>
	<20040617020117.GC5925@dcc.uchile.cl>

Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> I don't think we should explicitly forbid it.  I think it should be
> forbidden to close the outermost transaction inside a function (else the
> function would not be able to terminate correctly), but for levels
> before that one it'd be OK.

More specifically, a function cannot close any xact that was open when
it was called.  It can only close xacts that it started (or
equivalently, roll back to savepoints that it established).  Otherwise
the behavior is nonsensical.  Rollback of an outer transaction would
mean making like the function call never even happened, so the function
certainly couldn't expect to keep control.

			regards, tom lane



view thread (19+ messages)  latest in thread

Message-ID: <20920.1087573090@sss.pgh.pa.us>
Permalink:  ../20920.1087573090@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20920.1087573090@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@dcc.uchile.cl, chriskl@familyhealth.com.au, pgman@candle.pha.pa.us, blind@xythos.com, simon@2ndquadrant.com, pgsql-patches@postgresql.org
  Subject: Re: Nested transactions
  In-Reply-To: <20920.1087573090@sss.pgh.pa.us>
  References: <200406170136.i5H1aX727064@candle.pha.pa.us> <40D0FB7C.8030309@familyhealth.com.au> <20040617020117.GC5925@dcc.uchile.cl> <20920.1087573090@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox