Skip to content

Commit 81fd753

Browse files
committed
Incorporate README.fsync into main documentation body
1 parent b4c315b commit 81fd753

File tree

2 files changed

+34
-40
lines changed

2 files changed

+34
-40
lines changed

doc/README.fsync

Lines changed: 0 additions & 34 deletions
This file was deleted.

doc/src/sgml/runtime.sgml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.14 2000/07/15 21:35:47 petere Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.15 2000/07/16 14:47:57 petere Exp $
33
-->
44

55
<Chapter Id="runtime">
@@ -846,11 +846,39 @@ env PGOPTIONS='--geqo=off' psql
846846
<term>FSYNC (<type>boolean</type>)</term>
847847
<listitem>
848848
<para>
849-
When this is on (default), an <function>fsync()</function>
850-
call is done after each transaction. Turning this off
851-
increases performance but an operating system crash or power
852-
outage might cause data corruption. (Note that a crash of
853-
<productname>Postgres</productname> itself is not affected.)
849+
If this is option is on, the <productname>Postgres</> backend
850+
will use the <function>fsync()</> system call in several
851+
places to make sure that updates are physically written to
852+
disk and will not hang around in the write caches. This
853+
increases the chance that a database installation will still
854+
be usable after a operating system or hardware crashes by a
855+
large amount. (Crashes of the database server itself do
856+
<emphasis>not</> affect this consideration.)
857+
</para>
858+
859+
<para>
860+
However, this operation severely slows down
861+
<productname>Postgres</>, because at all those points it has
862+
to block and wait for the operating system to flush the
863+
buffers. Without <function>fsync</>, the operating system is
864+
allowed to do its best in buffering, sorting, and delaying
865+
writes, so this can be a <emphasis>very</> big perfomance
866+
increase. However, if the system crashes, parts of the data of
867+
a transaction that has already been committed -- according to
868+
the information on disk -- will still hang around in memory.
869+
Inconsistent data (i.e., data corruption) is therefore likely
870+
to occur.
871+
</para>
872+
873+
<para>
874+
This option is the subject of an eternal debate in the
875+
<productname>Postgres</> user and developer communities. Some
876+
always leave it off, some turn it off only for bulk loads,
877+
where there is a clear restart point if something goes wrong,
878+
some leave it on just to be on the safe side. Because it is
879+
the safe side, on is also the default. If you trust your
880+
operating system, your utility company, and your hardware, you
881+
might want to disable it.
854882
</para>
855883
</listitem>
856884
</varlistentry>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy