postgresql/doc/src/sgml/ref
Tom Lane b966dd6c42 Add fsync capability to initdb, and use sync_file_range() if available.
Historically we have not worried about fsync'ing anything during initdb
(in fact, initdb intentionally passes -F to each backend launch to prevent
it from fsync'ing).  But with filesystems getting more aggressive about
caching data, that's not such a good plan anymore.  Make initdb do a pass
over the finished data directory tree to fsync everything.  For testing
purposes, the -N/--nosync flag can be used to restore the old behavior.

Also, testing shows that on Linux, sync_file_range() is much faster than
posix_fadvise() for hinting to the kernel that an fsync is coming,
apparently because the latter blocks on a rather small request queue while
the former doesn't.  So use this function if available in initdb, and also
in the backend's pg_flush_data() (where it currently will affect only the
speed of CREATE DATABASE's cloning step).

We will later make pg_regress invoke initdb with the --nosync flag
to avoid slowing down cases such as "make check" in contrib.  But
let's not do so until we've shaken out any portability issues in this
patch.

Jeff Davis, reviewed by Andres Freund
2012-07-13 17:16:58 -04:00
..
abort.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
allfiles.sgml Implement streaming xlog for backup tools 2011-10-26 20:13:33 +02:00
alter_aggregate.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
alter_collation.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_conversion.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_database.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_default_privileges.sgml Add support for privileges on types 2011-12-20 00:05:19 +02:00
alter_domain.sgml Add support for renaming domain constraints 2012-04-03 08:11:51 +03:00
alter_extension.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
alter_foreign_data_wrapper.sgml Add ALTER FOREIGN DATA WRAPPER / RENAME and ALTER SERVER / RENAME 2011-12-09 20:42:30 +02:00
alter_foreign_table.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
alter_function.sgml Make CREATE/ALTER FUNCTION support NOT LEAKPROOF. 2012-02-15 10:45:08 -05:00
alter_group.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_index.sgml ALTER <thing> [IF EXISTS] ... allows silent DDL if required, 2012-01-23 23:25:04 +00:00
alter_language.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
alter_large_object.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
alter_opclass.sgml Add more ALTER <object> .. SET SCHEMA commands. 2010-11-26 17:31:54 -05:00
alter_operator.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_opfamily.sgml Add SP-GiST (space-partitioned GiST) index access method. 2011-12-17 16:42:30 -05:00
alter_role.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_schema.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
alter_sequence.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
alter_server.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
alter_table.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
alter_tablespace.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_trigger.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
alter_tsconfig.sgml Add more ALTER <object> .. SET SCHEMA commands. 2010-11-26 17:31:54 -05:00
alter_tsdictionary.sgml Add more ALTER <object> .. SET SCHEMA commands. 2010-11-26 17:31:54 -05:00
alter_tsparser.sgml Add more ALTER <object> .. SET SCHEMA commands. 2010-11-26 17:31:54 -05:00
alter_tstemplate.sgml Add more ALTER <object> .. SET SCHEMA commands. 2010-11-26 17:31:54 -05:00
alter_type.sgml Add support for privileges on types 2011-12-20 00:05:19 +02:00
alter_user_mapping.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
alter_user.sgml Add REPLICATION privilege for ROLEs 2010-12-29 11:05:03 +01:00
alter_view.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
analyze.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
begin.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
checkpoint.sgml Make the CHECKPOINT reference page more clear. 2011-10-18 20:14:51 -04:00
close.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
cluster.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
clusterdb.sgml doc: Fix for too many brackets in command synopses on man pages 2012-05-03 22:58:00 +03:00
comment.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
commit_prepared.sgml Add compatibility information for prepared transaction commands 2012-04-16 22:40:54 +03:00
commit.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
copy.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
create_aggregate.sgml Add support for privileges on types 2011-12-20 00:05:19 +02:00
create_cast.sgml Casts to or from a domain type are ignored; warn and document. 2012-04-24 09:20:53 -04:00
create_collation.sgml Make a code-cleanup pass over the collations patch. 2011-04-22 17:43:18 -04:00
create_conversion.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
create_database.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
create_domain.sgml Add support for privileges on types 2011-12-20 00:05:19 +02:00
create_extension.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
create_foreign_data_wrapper.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
create_foreign_table.sgml Add support for privileges on types 2011-12-20 00:05:19 +02:00
create_function.sgml Make CREATE/ALTER FUNCTION support NOT LEAKPROOF. 2012-02-15 10:45:08 -05:00
create_group.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
create_index.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
create_language.sgml Remove ancient downcasing code from procedural language operations. 2011-11-17 14:25:18 -05:00
create_opclass.sgml Add SP-GiST (space-partitioned GiST) index access method. 2011-12-17 16:42:30 -05:00
create_operator.sgml Add support for privileges on types 2011-12-20 00:05:19 +02:00
create_opfamily.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
create_role.sgml Make superuser imply replication privilege. The idea of a privilege that 2012-01-14 18:22:16 +02:00
create_rule.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
create_schema.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
create_sequence.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
create_server.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
create_table_as.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
create_table.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
create_tablespace.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
create_trigger.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
create_tsconfig.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
create_tsdictionary.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
create_tsparser.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
create_tstemplate.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
create_type.sgml Reworded sentence as suggested by Stephen Frost. 2012-05-19 14:44:56 +02:00
create_user_mapping.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
create_user.sgml Add REPLICATION privilege for ROLEs 2010-12-29 11:05:03 +01:00
create_view.sgml Typo fixes. 2011-12-22 17:57:17 -05:00
createdb.sgml doc: Fix for too many brackets in command synopses on man pages 2012-05-03 22:58:00 +03:00
createlang.sgml doc: Fix for too many brackets in command synopses on man pages 2012-05-03 22:58:00 +03:00
createuser.sgml Make documentation of --help and --version options more consistent 2012-06-18 02:46:59 +03:00
deallocate.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
declare.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
delete.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
discard.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
do.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_aggregate.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
drop_cast.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_collation.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_conversion.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_database.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_domain.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_extension.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
drop_foreign_data_wrapper.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_foreign_table.sgml Remove whitespace from end of lines 2011-08-07 16:11:55 +03:00
drop_function.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_group.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
drop_index.sgml Add DROP INDEX CONCURRENTLY [IF EXISTS], uses ShareUpdateExclusiveLock 2012-04-06 10:21:40 +01:00
drop_language.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_opclass.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_operator.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_opfamily.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_owned.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
drop_role.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_rule.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
drop_schema.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_sequence.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_server.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
drop_table.sgml Improve doc wording of drop table permission. 2011-10-15 10:08:02 -04:00
drop_tablespace.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
drop_trigger.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
drop_tsconfig.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_tsdictionary.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_tsparser.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_tstemplate.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
drop_type.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_user_mapping.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
drop_user.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
drop_view.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
dropdb.sgml Make documentation of --help and --version options more consistent 2012-06-18 02:46:59 +03:00
droplang.sgml doc: Fix for too many brackets in command synopses on man pages 2012-05-03 22:58:00 +03:00
dropuser.sgml Make documentation of --help and --version options more consistent 2012-06-18 02:46:59 +03:00
ecpg-ref.sgml Make documentation of --help and --version options more consistent 2012-06-18 02:46:59 +03:00
end.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
execute.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
explain.sgml Make EXPLAIN (BUFFERS) track blocks dirtied, as well as those written. 2012-02-22 20:33:05 -05:00
fetch.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
grant.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
initdb.sgml Add fsync capability to initdb, and use sync_file_range() if available. 2012-07-13 17:16:58 -04:00
insert.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
listen.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
load.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
lock.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
move.sgml Duplicate expansion of "direction" from FETCH's synopsis into MOVE 2011-04-04 12:04:43 -04:00
notify.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
pg_basebackup.sgml Make documentation of --help and --version options more consistent 2012-06-18 02:46:59 +03:00
pg_config-ref.sgml Make documentation of --help and --version options more consistent 2012-06-18 02:46:59 +03:00
pg_controldata.sgml Some reference page improvements 2012-05-20 01:15:55 +03:00
pg_ctl-ref.sgml Make documentation of --help and --version options more consistent 2012-06-18 02:46:59 +03:00
pg_dump.sgml Rewrite --section option to decouple it from --schema-only/--data-only. 2012-05-29 23:22:14 -04:00
pg_dumpall.sgml Put options in some sensible order 2011-05-25 21:53:26 +03:00
pg_receivexlog.sgml Make documentation of --help and --version options more consistent 2012-06-18 02:46:59 +03:00
pg_resetxlog.sgml Fix pg_upgrade, broken by the xlogid/segno -> 64-bit int refactoring. 2012-06-26 07:49:02 +03:00
pg_restore.sgml Rewrite --section option to decouple it from --schema-only/--data-only. 2012-05-29 23:22:14 -04:00
postgres-ref.sgml Make documentation of --help and --version options more consistent 2012-06-18 02:46:59 +03:00
postmaster.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
prepare_transaction.sgml Add compatibility information for prepared transaction commands 2012-04-16 22:40:54 +03:00
prepare.sgml Redesign the plancache mechanism for more flexibility and efficiency. 2011-09-16 00:43:52 -04:00
psql-ref.sgml Documentation spell and markup checking 2012-06-08 00:06:20 +03:00
reassign_owned.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
reindex.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
reindexdb.sgml Fix reindexdb manual page to say --maintenance-db controls what is 2012-05-22 17:31:46 -04:00
release_savepoint.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
reset.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
revoke.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
rollback_prepared.sgml Add compatibility information for prepared transaction commands 2012-04-16 22:40:54 +03:00
rollback_to.sgml Some markup cleanup to deconfuse the find_gt_lt tool 2011-08-30 20:32:49 +03:00
rollback.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
savepoint.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
security_label.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
select_into.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
select.sgml Document that VALUES can be used in WITH 2012-04-14 09:08:08 +03:00
set_constraints.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
set_role.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
set_session_auth.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
set_transaction.sgml Tweak markup to avoid extra whitespace in man pages 2012-03-28 20:37:19 +03:00
set.sgml Simplify handling of the timezone GUC by making initdb choose the default. 2011-09-09 17:59:11 -04:00
show.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
start_transaction.sgml Implement genuine serializable isolation level. 2011-02-08 00:09:08 +02:00
truncate.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
unlisten.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00
update.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
vacuum.sgml Make placeholders in SQL command help more consistent and precise 2012-06-22 01:06:14 +03:00
vacuumdb.sgml doc: Fix for too many brackets in command synopses on man pages 2012-05-03 22:58:00 +03:00
values.sgml Fix a whitespace issue with the man pages 2011-08-07 10:55:32 +03:00