> > > I am fine with special casing autocommit.  Is that what you are
> > > suggesting?
> > 
> > I think he means:
> > 
> > Ex:
> > SET autocommit TO off;
> > SHOW autocommit;
> > ROLLBACK;
> > # warning about being outside of a transaction
> > BEGIN;
> > SET autocommit TO on;
> > SHOW autocommit;    # shows on
> > ROLLBACK;
> > SHOW autocommit;    # shows off
> > 
> > Only have the SET's in a transaction/rollback-able if they're made
> > inside of a transaction, otherwise leave them as atomic changes.  -sc
> 
> But it seems so illogical that SET doesn't start a transaction, but
> if it is in a transaction, it is rolled back, and this doesn't help
> our statement_timeout example except to require that they do BEGIN
> to start the transaction even when autocommit is off.

Really?  To me that makes perfect sense.  Logic:

*) Only BEGIN starts a transaction
*) Database or session tunables are adjusted with SET
*) Only things that happen inside of a transaction are rollback-able
*) SET operations that happen outside of a transaction are atomic
 changes that aren't subject to being rolled back

What about that doesn't make sense?  Having SET begin a transaction
seems like a gross violation of POLS and likely to contradict the spec
and cause problems with many applications.  -sc

-- 
Sean Chittenden

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply via email to