At 03:09 PM 9/02/2000 +1100, James Morris wrote:
>On Wed, 9 Feb 2000, Brian Martin wrote:
>
>> and guarantee no half-done transaction if the h/w, o/s, power crashes ?
>
>Just out of interest, how does PostgreSQL guarantee transactions in these
>cases with a standard filesystem?

James,
I've not yet used PostgreSQL, as did not have enough disk space until
yesterday,
so can only assume it does what most other db's do when using filesystem.

Generic "real database" operation (not necessarily how postgresql does it) ...
at transaction end, issues fflush() or similar calls on specific files,
usually on a transaction log file, to force disk write (not just file sytem
cache update). The log file contains only the updated parts, before images
of recs deleted/updated, after images of recs added, plus control info,
markers for begin/end trans, etc.
The log file contents take precedence over whatever
the main data file says in the event of a discrepancy.
At startup the log file is read & the data file brought up to date
if any incomplete transactions detected.
There's more to it, no room to explain here.

Some db's also allow use of dedicated partition for the data, bypassing the
filesystem, e.g. Sybase. This is less flexible but can be faster.

Brian
----------------------------------------------
Brian Martin, [EMAIL PROTECTED]
Future Software Pty Ltd, Sydney, Australia.


--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to