postgresql/doc/src/sgml
Heikki Linnakangas 9de3aa65f0 Rewrite the GiST insertion logic so that we don't need the post-recovery
cleanup stage to finish incomplete inserts or splits anymore. There was two
reasons for the cleanup step:

1. When a new tuple was inserted to a leaf page, the downlink in the parent
needed to be updated to contain (ie. to be consistent with) the new key.
Updating the parent in turn might require recursively updating the parent of
the parent. We now handle that by updating the parent while traversing down
the tree, so that when we insert the leaf tuple, all the parents are already
consistent with the new key, and the tree is consistent at every step.

2. When a page is split, we need to insert the downlink for the new right
page(s), and update the downlink for the original page to not include keys
that moved to the right page(s). We now handle that by setting a new flag,
F_FOLLOW_RIGHT, on the non-rightmost pages in the split. When that flag is
set, scans always follow the rightlink, regardless of the NSN mechanism used
to detect concurrent page splits. That way the tree is consistent right after
split, even though the downlink is still missing. This is very similar to the
way B-tree splits are handled. When the downlink is inserted in the parent,
the flag is cleared. To keep the insertion algorithm simple, when an
insertion sees an incomplete split, indicated by the F_FOLLOW_RIGHT flag, it
finishes the split before doing anything else.

These changes allow removing the whole "invalid tuple" mechanism, but I
retained the scan code to still follow invalid tuples correctly. While we
don't create any such tuples anymore, we want to handle them gracefully in
case you pg_upgrade a GiST index that has them. If we encounter any on an
insert, though, we just throw an error saying that you need to REINDEX.

The issue that got me into doing this is that if you did a checkpoint while
an insert or split was in progress, and the checkpoint finishes quickly so
that there is no WAL record related to the insert between RedoRecPtr and the
checkpoint record, recovery from that checkpoint would not know to finish
the incomplete insert. IOW, we have the same issue we solved with the
rm_safe_restartpoint mechanism during normal operation too. It's highly
unlikely to happen in practice, and this fix is far too large to backpatch,
so we're just going to live with in previous versions, but this refactoring
fixes it going forward.

With this patch, you don't get the annoying
'index "FOO" needs VACUUM or REINDEX to finish crash recovery' notices
anymore if you crash at an unfortunate moment.
2010-12-23 16:21:47 +02:00
..
ref Typo fix. 2010-12-22 09:33:34 -05:00
.gitignore Add assorted other documentation build targets to documentation gitignore. 2010-09-22 18:08:45 -04:00
Makefile Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
README.links Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
acronyms.sgml Fix remaining stray references to CVS. 2010-09-22 19:51:39 -04:00
adminpack.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
advanced.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
arch-dev.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
array.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
auth-delay.sgml New contrib module, auth_delay. 2010-11-27 07:22:25 -05:00
auto-explain.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
backup.sgml Document that a CHECKPOINT before taking a file system snapshot can 2010-11-24 18:41:28 -05:00
biblio.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
bki.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
btree-gin.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
btree-gist.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
catalogs.sgml Document replacement of pg_class.relistemp with relpersistence. 2010-12-13 13:08:45 -05:00
charset.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
chkpass.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
citext.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
client-auth.sgml Support suffix matching of host names in pg_hba.conf 2010-10-24 15:54:00 +03:00
config.sgml Force default wal_sync_method to be fdatasync on Linux. 2010-12-08 20:01:09 -05:00
contacts.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
contrib-spi.sgml Allow moddatetime's target column to be of type timestamptz. 2010-11-04 16:34:47 -04:00
contrib.sgml New contrib module, auth_delay. 2010-11-27 07:22:25 -05:00
cube.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
datatype.sgml Document timestamptz a little better. 2010-12-15 20:53:40 -05:00
datetime.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
dblink.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
ddl.sgml Make title capitalization consistent with surroundings 2010-10-13 20:05:16 +03:00
dfunc.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
dict-int.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
dict-xsyn.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
diskusage.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
dml.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
docguide.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
dummy-seclabel.sgml Minor corrections to dummy_seclabel documentation. 2010-11-18 10:30:24 -05:00
earthdistance.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
ecpg.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
errcodes.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
extend.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
external-projects.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
features.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
filelist.sgml New contrib module, auth_delay. 2010-11-27 07:22:25 -05:00
fixrtf Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
func.sgml Some copy editing of pg_read_binary_file() patch. 2010-12-15 21:02:31 -05:00
fuzzystrmatch.sgml Add levenshtein_less_equal, optimized version for small distances. 2010-10-19 09:51:06 -04:00
generate_history.pl Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
geqo.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
gin.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
gist.sgml Rewrite the GiST insertion logic so that we don't need the post-recovery 2010-12-23 16:21:47 +02:00
high-availability.sgml Note explicitly that hash indexes are also not replicated because they're not 2010-10-26 22:53:41 +03:00
history.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
hstore.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
indexam.sgml Add external documentation for KNNGIST. 2010-12-03 23:49:06 -05:00
indices.sgml Add external documentation for KNNGIST. 2010-12-03 23:49:06 -05:00
info.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
information_schema.sgml Support triggers on views. 2010-10-10 13:45:07 -04:00
install-windows.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
installation.sgml Support for collecting crash dumps on Windows 2010-12-19 16:45:28 +01:00
intagg.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
intarray.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
intro.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
isn.sgml Add some caveats to the contrib/isn docs. 2010-10-19 22:48:19 -04:00
jadetex.cfg Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
keywords.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
legal.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
libpq.sgml Add PQlibVersion() function to libpq 2010-12-22 14:23:56 +01:00
lo.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
lobj.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
ltree.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
maintenance.sgml Fix a missed explanation of auto-analyze threshold, per Joe Miller. 2010-09-21 16:40:41 -04:00
manage-ag.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
mk_feature_tables.pl Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
monitoring.sgml Add new buffers_backend_fsync field to pg_stat_bgwriter. 2010-11-15 12:42:59 -05:00
mvcc.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
nls.sgml Fix remaining stray references to CVS. 2010-09-22 19:51:39 -04:00
notation.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
oid2name.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pageinspect.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
passwordcheck.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
perform.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pgarchivecleanup.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
pgbench.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pgbuffercache.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pgcrypto.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pgfreespacemap.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pgrowlocks.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pgstandby.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pgstatstatements.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pgstattuple.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pgtrgm.sgml Add KNNGIST support to contrib/pg_trgm. 2010-12-04 00:16:21 -05:00
pgupgrade.sgml Use "upgrade" in preference over "migrate" in pg_upgrade messages and 2010-12-15 07:11:31 -05:00
planstats.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
plhandler.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
plperl.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
plpgsql.sgml Add new SQL function, format(text). 2010-11-20 22:33:27 -05:00
plpython.sgml plpython has plpy.Error instead of plpy.ERROR 2010-11-09 11:02:17 -03:00
pltcl.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
postgres.sgml Remove anonymous cvs instructions, and replace them with instructions 2010-09-22 20:10:28 +02:00
problems.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
protocol.sgml Fix typo 2010-12-20 12:05:12 -03:00
queries.sgml Allow WITH clauses to be attached to INSERT, UPDATE, DELETE statements. 2010-10-15 19:55:25 -04:00
query.sgml Add index entries for more functions 2010-11-24 00:00:34 +02:00
recovery-config.sgml Improvements to docs about pg_archive_cleanup and use of archives 2010-10-14 19:30:15 +01:00
reference.sgml Merge docs for CREATE CONSTRAINT TRIGGER and CREATE TRIGGER 2010-11-09 16:52:46 -03:00
regress.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
release-7.4.sgml Use a separate interpreter for each calling SQL userid in plperl and pltcl. 2010-09-30 17:18:51 -04:00
release-8.0.sgml Use a separate interpreter for each calling SQL userid in plperl and pltcl. 2010-09-30 17:18:51 -04:00
release-8.1.sgml Update release notes for releases 9.0.2, 8.4.6, 8.3.13, 8.2.19, and 8.1.23. 2010-12-13 20:22:52 -05:00
release-8.2.sgml Update release notes for releases 9.0.2, 8.4.6, 8.3.13, 8.2.19, and 8.1.23. 2010-12-13 20:22:52 -05:00
release-8.3.sgml Update release notes for releases 9.0.2, 8.4.6, 8.3.13, 8.2.19, and 8.1.23. 2010-12-13 20:22:52 -05:00
release-8.4.sgml Update release notes for releases 9.0.2, 8.4.6, 8.3.13, 8.2.19, and 8.1.23. 2010-12-13 20:22:52 -05:00
release-9.0.sgml Update release notes for releases 9.0.2, 8.4.6, 8.3.13, 8.2.19, and 8.1.23. 2010-12-13 20:22:52 -05:00
release-9.1.sgml Change version number in release notes to 9.1alpha2 2010-10-30 23:37:36 +03:00
release-old.sgml Fix inconsistent capitalization of "PL/pgSQL". 2010-09-22 21:57:37 -04:00
release.sgml Remove anonymous cvs instructions, and replace them with instructions 2010-09-22 20:10:28 +02:00
rowtypes.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
rules.sgml Support triggers on views. 2010-10-10 13:45:07 -04:00
runtime.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
seg.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
sourcerepo.sgml Do some copy-editing on the Git usage docs. 2010-09-22 20:22:26 -04:00
sources.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
spi.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
sql.sgml Be consistent about writing "[, ...]" instead "[,...]" in the docs. 2010-11-29 11:53:27 +02:00
sslinfo.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
standalone-install.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
start.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
storage.sgml Update storage.sgml to describe the 9.0 tablespace directory layout. 2010-10-19 21:53:26 -04:00
stylesheet-common.xsl Reorganize XSLT stylesheet support. Put common things into a separate 2006-12-10 16:01:06 +00:00
stylesheet-fo.xsl Reorganize XSLT stylesheet support. Put common things into a separate 2006-12-10 16:01:06 +00:00
stylesheet-hh.xsl Reorganize XSLT stylesheet support. Put common things into a separate 2006-12-10 16:01:06 +00:00
stylesheet-man.xsl Extensive ECPG documentation improvements 2010-10-10 13:46:02 +03:00
stylesheet.css Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
stylesheet.dsl Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
stylesheet.xsl Ship documentation without intermediate tarballs 2009-08-09 22:47:59 +00:00
syntax.sgml Prevent invoking I/O conversion casts via functional/attribute notation. 2010-11-07 13:03:19 -05:00
tablefunc.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
test-parser.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
textsearch.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
trigger.sgml Support triggers on views. 2010-10-10 13:45:07 -04:00
tsearch2.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
typeconv.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
unaccent.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
user-manag.sgml Undo some poorly-thought-out "proofreading improvements". 2010-10-05 18:48:13 -04:00
uuid-ossp.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
vacuumlo.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
wal.sgml Document that BBU's do not allow partial page writes to be safely turned 2010-12-22 21:12:00 -05:00
xaggr.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
xfunc.sgml Prevent invoking I/O conversion casts via functional/attribute notation. 2010-11-07 13:03:19 -05:00
xindex.sgml Add external documentation for KNNGIST. 2010-12-03 23:49:06 -05:00
xml2.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
xoper.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
xplang.sgml Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
xtypes.sgml Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00

README.links

<!-- doc/src/sgml/README.links -->

Linking within SGML documents can be confusing, so here is a summary:


Intra-document Linking
----------------------

<xref>
	use to get link text from the title of the target link; has no
	close tag
	http://www.oasis-open.org/docbook/documentation/reference/html/xref.html

<link>
	use to supply text for the link, requires </link>
	http://www.oasis-open.org/docbook/documentation/reference/html/link.html

linkend=
	controls the target of the link/xref, required

endterm=
	for <xref>, allows the text of the link/xref to be taken from a
	different link target title


External Linking
----------------

<ulink>
	like <link>, but uses a URL (not a document target);  requires
	</ulink>; if no text is specified, the URL appears as the link text
	http://www.oasis-open.org/docbook/documentation/reference/html/ulink.html

url=
	used by <ulink> to specify the URL, required


Guidelines
----------

o  If you want to supply text, use <link>, else <xref>
o  Do not use text with <ulink> so the URL appears in printed output
o  You can supply text at the target location with 'xreflabel'