Re: Multiple Xids in PGPROC? - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Multiple Xids in PGPROC?
Date
Msg-id 874qqvxyux.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Multiple Xids in PGPROC?  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:

> > I hope not, because for many of us there will be as many (if not more)
> > subtransactions than standard transactions.
> 
> How can that possibly be true?  Every statement executed in postgres is a
> "transaction"  how many subtransactions are really needed and how can they be
> as common as normal transactions?

Well consider that one thing discussed on this list previously was using
subtransactions to handle being able to continue after an error in a query.

Then any situation where autocommit was off would have every single query
being executed in a subtransaction within the main transaction. So a psql
script would likely be a single big transaction but every statement in it a
subtransaction. Or a web application could treat every page request as a
single atomic transaction but every individual query would automatically be a
subtransaction.

This would let a user C-c a large query and try a different way of writing it
without having to restart the whole sequence of commands in the transaction.
Or even simply correct a typo which is the big annoyance everyone's always
complaining about.

-- 
greg



pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: Re: Multiple Xids in PGPROC?
Next
From: Neil Conway
Date:
Subject: Re: Resource allocation?