-# $PostgreSQL: pgsql/config/docbook.m4,v 1.10 2008/11/26 11:26:54 petere Exp $
+# $PostgreSQL: pgsql/config/docbook.m4,v 1.11 2009/08/04 22:04:37 petere Exp $
# PGAC_PROG_JADE
# --------------
else
AC_PATH_PROGS(COLLATEINDEX, collateindex.pl)
fi])# PGAC_PATH_COLLATEINDEX
-
-
-# PGAC_PATH_DOCBOOK2MAN
-# ---------------------
-# Find docbook2man program from the docbook2X package. Upstream calls
-# this program docbook2man, but there is also a different docbook2man
-# out there from the docbook-utils package. Thus, the program we want
-# is called docbook2x-man on Debian and db2x_docbook2man on Fedora.
-#
-# (Consider rewriting this macro using AC_PATH_PROGS_FEATURE_CHECK
-# when switching to Autoconf 2.62+.)
-AC_DEFUN([PGAC_PATH_DOCBOOK2MAN],
-[AC_CACHE_CHECK([for docbook2man], [ac_cv_path_DOCBOOK2MAN],
-[if test -z "$DOCBOOK2MAN"; then
- _AS_PATH_WALK([],
- [for ac_prog in docbook2x-man db2x_docbook2man docbook2man; do
- ac_path="$as_dir/$ac_prog"
- AS_EXECUTABLE_P(["$ac_path"]) || continue
- if "$ac_path" --version 2>/dev/null | $GREP docbook2x >/dev/null 2>&1; then
- ac_cv_path_DOCBOOK2MAN=$ac_path
- break
- fi
- done])
-else
- ac_cv_path_DOCBOOK2MAN=$DOCBOOK2MAN
-fi])
-DOCBOOK2MAN=$ac_cv_path_DOCBOOK2MAN
-AC_SUBST(DOCBOOK2MAN)
-])# PGAC_PATH_DOCBOOK2MAN
ac_subst_vars='LTLIBOBJS
vpath_build
-DOCBOOK2MAN
-SGMLSPL
+OSX
+XSLTPROC
COLLATEINDEX
DOCBOOKSTYLE
have_docbook
done
fi
-for ac_prog in sgmlspl
+for ac_prog in xsltproc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_SGMLSPL+set}" = set; then
+if test "${ac_cv_prog_XSLTPROC+set}" = set; then
$as_echo_n "(cached) " >&6
else
- if test -n "$SGMLSPL"; then
- ac_cv_prog_SGMLSPL="$SGMLSPL" # Let the user override the test.
+ if test -n "$XSLTPROC"; then
+ ac_cv_prog_XSLTPROC="$XSLTPROC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_SGMLSPL="$ac_prog"
+ ac_cv_prog_XSLTPROC="$ac_prog"
$as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
fi
fi
-SGMLSPL=$ac_cv_prog_SGMLSPL
-if test -n "$SGMLSPL"; then
- { $as_echo "$as_me:$LINENO: result: $SGMLSPL" >&5
-$as_echo "$SGMLSPL" >&6; }
+XSLTPROC=$ac_cv_prog_XSLTPROC
+if test -n "$XSLTPROC"; then
+ { $as_echo "$as_me:$LINENO: result: $XSLTPROC" >&5
+$as_echo "$XSLTPROC" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
- test -n "$SGMLSPL" && break
+ test -n "$XSLTPROC" && break
done
-{ $as_echo "$as_me:$LINENO: checking for docbook2man" >&5
-$as_echo_n "checking for docbook2man... " >&6; }
-if test "${ac_cv_path_DOCBOOK2MAN+set}" = set; then
+for ac_prog in osx sgml2xml sx
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OSX+set}" = set; then
$as_echo_n "(cached) " >&6
else
- if test -z "$DOCBOOK2MAN"; then
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ if test -n "$OSX"; then
+ ac_cv_prog_OSX="$OSX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_prog in docbook2x-man db2x_docbook2man docbook2man; do
- ac_path="$as_dir/$ac_prog"
- { test -f "$ac_path" && $as_test_x "$ac_path"; } || continue
- if "$ac_path" --version 2>/dev/null | $GREP docbook2x >/dev/null 2>&1; then
- ac_cv_path_DOCBOOK2MAN=$ac_path
- break
- fi
- done
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OSX="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
done
IFS=$as_save_IFS
-else
- ac_cv_path_DOCBOOK2MAN=$DOCBOOK2MAN
fi
fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_DOCBOOK2MAN" >&5
-$as_echo "$ac_cv_path_DOCBOOK2MAN" >&6; }
-DOCBOOK2MAN=$ac_cv_path_DOCBOOK2MAN
+OSX=$ac_cv_prog_OSX
+if test -n "$OSX"; then
+ { $as_echo "$as_me:$LINENO: result: $OSX" >&5
+$as_echo "$OSX" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ test -n "$OSX" && break
+done
# Thread testing
dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.607 2009/07/24 15:03:07 tgl Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.608 2009/08/04 22:04:36 petere Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
PGAC_CHECK_DOCBOOK(4.2)
PGAC_PATH_DOCBOOK_STYLESHEETS
PGAC_PATH_COLLATEINDEX
-AC_CHECK_PROGS(SGMLSPL, sgmlspl)
-PGAC_PATH_DOCBOOK2MAN
+AC_CHECK_PROGS(XSLTPROC, xsltproc)
+AC_CHECK_PROGS(OSX, [osx sgml2xml sx])
# Thread testing
#
# PostgreSQL documentation makefile
#
-# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.119 2009/07/20 18:34:58 petere Exp $
+# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.120 2009/08/04 22:04:37 petere Exp $
#
#----------------------------------------------------------------------------
NSGMLS = nsgmls
endif
-ifndef SGMLSPL
-SGMLSPL = sgmlspl
+ifndef OSX
+OSX = osx
endif
-ifndef DOCBOOK2MAN
-DOCBOOK2MAN = docbook2man_is_missing
+ifndef XSLTPROC
+XSLTPROC = xsltproc
endif
-# docbook2man generates man pages from docbook refentry source code.
-D2MSCRIPT= $(D2MDIR)/docbook2man-spec.pl
-D2MLINKS = $(D2MDIR)/docbook2man-spec_makelinks
+override XSLTPROCFLAGS += --stringparam pg.version '$(VERSION)'
GENERATED_SGML = bookindex.sgml version.sgml \
## Man pages
##
-.PHONY: html man draft clean
+.PHONY: man
-DEFAULTSECTION = l
+man: man-stamp
-fix_man_xrefs = $(PERL) -npi -e 's{\[XRef to GUC-([A-Z0-9-]*)\]}{($$l = $$1) =~ tr/A-Z-/a-z_/, $$l}ge || s{\[XRef to [A-Z0-9-]*\]}{in the documentation}g'
-lowercase = tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'
-
-man: postgres.sgml $(ALLSGML)
- $(NSGMLS) $(NSGMLS_FLAGS) $(SGMLINCLUDE) $< | $(SGMLSPL) $(D2MSCRIPT) --lowercase --section $(DEFAULTSECTION) --date "`date '+%Y-%m-%d'`"
-# One more time, to resolve cross-references
- $(NSGMLS) $(NSGMLS_FLAGS) $(SGMLINCLUDE) $< | $(SGMLSPL) $(D2MSCRIPT) --lowercase --section $(DEFAULTSECTION) --date "`date '+%Y-%m-%d'`"
- $(fix_man_xrefs) *.1 *.7
- $(mkinstalldirs) man1 man7
- $(D2MLINKS) < manpage.links
- mv *.1 man1/
- mv *.7 man7/
- rm *.$(DEFAULTSECTION)
-# manpage.links doesn't handle lowercase, needs fixups
- cd man7 && for file in `awk '{ print $$2 }' ../manpage.links`; do $(lowercase) <$$file >`echo $$file | $(lowercase)` && rm $$file || exit; done
+man-stamp: stylesheet-man.xsl postgres.xml
+ $(XSLTPROC) $(XSLTPROCFLAGS) $^
+ rm man1/SPI* man1/dblink*
+ touch $@
##
all: html
+.PHONY: html draft
+
JADE.html.call = $(JADE) $(JADEFLAGS) $(SPFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -t sgml -i output-html
# The draft target creates HTML output in draft mode, without index (for faster build).
## XSLT processing
##
-OSX = osx # (may be called sx or sgml2xml on some systems)
-XSLTPROC = xsltproc
-
postgres.xml: postgres.sgml $(ALMOSTALLSGML)
$(OSX) -D. -x lower $< | \
$(PERL) -p -e 's/\[(amp|copy|egrave|gt|lt|mdash|nbsp|ouml|pi|quot|uuml) *\]/\&\1;/g;' \
>$@
# ' hello Emacs
-override XSLTPROCFLAGS += --stringparam pg.version '$(VERSION)'
-
xslthtml: stylesheet.xsl postgres.xml
$(XSLTPROC) $(XSLTPROCFLAGS) $^
.SUFFIXES:
-##
-## Experimental man page building through docbook2x
-##
-
-manx: postgres.xml stylesheet-man.xsl
- $(DOCBOOK2MAN) --solinks -s $(srcdir)/stylesheet-man.xsl --string-param default-manpage-section=$(DEFAULTSECTION) $<
- $(mkinstalldirs) man1 man7
- mv *.1 man1/
- mv *.7 man7/
- rm *.$(DEFAULTSECTION)
-
-
##
## Check
##
# HTML
rm -f *.html html-stamp
# man
- rm -rf *.1 *.7 *.$(DEFAULTSECTION) man1 man7 manpage.refs manpage.links manpage.log
+ rm -rf man1 man7 man-stamp
# print
rm -f *.rtf *.tex-ps *.tex-pdf *.dvi *.aux *.log *.ps *.pdf *.out *.fot
# index
-
+
Documentation
This is the definition of DocBook itself. We currently use
- version 4.2; you cannot use later or earlier versions. Note
- that there is also an
XML version of DocBook
- — do not use that.
+ version 4.2; you cannot use later or earlier versions. You
+ need the
SGML variant of the DocBook DTD,
+ but to build man pages you also need the
XML
+ variant of the same version.
-
openjade.sourceforge.net">OpenJade
+
wiki.docbook.org/topic/DocBookDssslStylesheets">DocBook DSSSL Stylesheets
- This is the base package of
SGML processing.
- It contains an
SGML parser, a
-
DSSSL processor (that is, a program to
- convert
SGML to other formats using
-
DSSSL stylesheets), as well as a number of
- related tools.
Jade is now being
- maintained by the OpenJade group, no longer by James Clark.
+ These contain the processing instructions for converting the
+ DocBook sources to other formats, such as
-
DssslStylesheets">DocBook DSSSL Stylesheets
+
XslStylesheets">DocBook XSL Stylesheets
- These contain the processing instructions for converting the
- DocBook sources to other formats, such as
+ This is another stylesheet for converting DocBook to other
+ formats. We currently use this to produce man pages and
+ optionally HTMLHelp. You can also use this toolchain to
+ produce HTML or PDF output, but official PostgreSQL releases
+ use the DSSSL stylesheets for that.
-
search.cpan.org/dist/SGMLSpm/">SGMLSpm
+
openjade.sourceforge.net">OpenJade
- This optional package is used to create man pages.
+ This is the base package of
SGML processing.
+ It contains an
SGML parser, a
+
DSSSL processor (that is, a program to
+ convert
SGML to other formats using
+
DSSSL stylesheets), as well as a number of
+ related tools.
Jade is now being
+ maintained by the OpenJade group, no longer by James Clark.
-
docbook2x.sourceforge.net">DocBook2X>
+
xmlsoft.org/XSLT/">Libxslt for xsltproc>
- This optional package is also used to create man pages. You
- want the docbook2man-sgmlspl package, not
- the main docbook2x package.
+ This is the processing tool to use with the XSLT stylesheets
+ (like jade is the processing tool for DSSSL
+ stylesheets).
available for
Debian GNU/Linux.
To install, simply use:
-apt-get install openjade1.3
-apt-get install docbook
-apt-get install docbook-dsssl
-apt-get install sgmlspl # for the man pages
+apt-get install docbook docbook-dsssl docbook-xsl openjade xsltproc
- (The plain openjade package installs
- OpenJade 1.4, which seems not to work.)
checking for onsgmls... onsgmls
checking for openjade... openjade
checking for DocBook V4.2... yes
-checking for DocBook stylesheets... /usr/lib/sgml/stylesheets/nwalsh-modular
-checking for sgmlspl... sgmlspl
+checking for DocBook stylesheets... /usr/share/sgml/docbook/stylesheet/dsssl/modular
+checking for collateindex.pl... /usr/bin/collateindex.pl
+checking for xsltproc... xsltproc
+checking for osx... osx
If neither onsgmls nor
- nsgmls were found then you will not see the
- remaining 4 lines. nsgmls is part of the Jade
+ nsgmls were found then some of the following tests
+ will be skipped. nsgmls is part of the Jade
package. You can pass the environment variables
JADE and NSGMLS to configure to point
to the programs if they are not found automatically. If
Manpages
- We use the
docbook2man-sgmlspl utility
- from the
DocBook2X project to
+ We use the DocBook XSL stylesheets to
refentry pages to *roff output suitable for man
pages. The man pages are also distributed as a tar archive,
pages, use the commands:
cd doc/src/sgml
-gmake man D2MDIR=directory
+gmake man
- Use the D2MDIR variable to specify the name of
- the directory where the
- file docbook2man-spec.pl from
- the
docbook2man-sgmlspl package resides.
- There is no default for that. Since that package is not available
- or outdated in many packaging systems, you might want to just
- download the source code tarball and unpack it. No building is
- required. Then the path is something
- like D2MDIR=/home/you/somewhere/docbook2man-sgmlspl-1.0/perl.
- You may get warnings like this:
-
-Warning: unrecognized SDATA '[scaron]': please add definition to docbook2man-spec.pl
-Warning: unrecognized SDATA '[ouml ]': please add definition to docbook2man-spec.pl
-
- which can ignore if (and only if) you are using the latest version
- of docbook2man-spec.pl
- and you are not seeing any other SDATA warnings besides those.
To create the man page package for a release, use the following commands:
cd doc/src
-gmake man.tar.gz D2MDIR=directory
+gmake man.tar.gz
which will result in a tar file being generated in the
doc/src directory.
-
+
The PostgreSQL Global Development Group
&legal;
In the default
PostgreSQL configuration,
-
+ the autovacuum daemon (see )
takes care of automatic analyzing of tables when they are first loaded
with data, and as they change throughout regular operation.
When autovacuum is disabled,
-"1.0" encoding="utf-8"?>
+'1.0'?>
- version="1.0">
+ xmlns:exsl="http://exslt.org/common"
+ version='1.0'
+ exclude-result-prefixes="exsl">
-
+
+
-
+
+
+
+
+
+0
+0
+
+
+
+40
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (
+
+
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Note:
+ (soelim stub)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
Triggers
-
A Complete Example
+
A Complete Trigger Example
Here is a very simple example of a trigger function written in C.
# -*-makefile-*-
-# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.254 2009/06/23 03:46:00 tgl Exp $
+# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.255 2009/08/04 22:04:37 petere Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
-have_docbook = @have_docbook@
-DOCBOOKSTYLE = @DOCBOOKSTYLE@
-COLLATEINDEX = @COLLATEINDEX@
-DOCBOOK2MAN = @DOCBOOK2MAN@
-
##########################################################################
#
# Documentation
-JADE = @JADE@
-NSGMLS = @NSGMLS@
-SGMLSPL = @SGMLSPL@
+have_docbook = @have_docbook@
+COLLATEINDEX = @COLLATEINDEX@
+DOCBOOKSTYLE = @DOCBOOKSTYLE@
+JADE = @JADE@
+NSGMLS = @NSGMLS@
+OSX = @OSX@
+XSLTPROC = @XSLTPROC@
# Code coverage