Use SA_RESTART for all signals, including SIGALRM.

The exclusion of SIGALRM dates back to Berkeley days, when Postgres used
SIGALRM in only one very short stretch of code.  Nowadays, allowing it to
interrupt kernel calls doesn't seem like a very good idea, since its use
for statement_timeout means SIGALRM could occur anyplace in the code, and
there are far too many call sites where we aren't prepared to deal with
EINTR failures.  When third-party code is taken into consideration, it
seems impossible that we ever could be fully EINTR-proof, so better to
use SA_RESTART always and deal with the implications of that.  One such
implication is that we should not assume pg_usleep() will be terminated
early by a signal.  Therefore, long sleeps should probably be replaced
by WaitLatch operations where practical.

Back-patch to 9.3 so we can get some beta testing on this change.
Fix pg_restore -l with the directory archive to display the correct format name.

Back-patch to 9.1 where the directory archive was introduced.
Use WaitLatch, not pg_usleep, for delaying in pg_sleep().

This avoids platform-dependent behavior wherein pg_sleep() might fail to be
interrupted by statement timeout, query cancel, SIGTERM, etc.  Also, since
there's no reason to wake up once a second any more, we can reduce the
power consumption of a sleeping backend a tad.

Back-patch to 9.3, since use of SA_RESTART for SIGALRM makes this a bigger
issue than it used to be.
Fix description of archive format which pg_restore -j supports.
Add buffer_std flag to MarkBufferDirtyHint().

MarkBufferDirtyHint() writes WAL, and should know if it's got a
standard buffer or not. Currently, the only callers where buffer_std
is false are related to the FSM.

In passing, rename XLOG_HINT to XLOG_FPI, which is more descriptive.

Back-patch to 9.3.
psql: Re-allow -1 together with -c or -l
Fix docs on lock level for ALTER TABLE VALIDATE

ALTER TABLE .. VALIDATE CONSTRAINT previously
gave incorrect details about lock levels and
therefore incomplete reasons to use the option.

Initial bug report and fix from Marko Tiikkaja
Reworded by me to include comments by Kevin Grittner
Fix the create_index regression test for Danish collation.

In Danish collations, there are letter combinations which sort
higher than 'Z'.  A test for values > 'WA' was picking up rows
where the value started with 'AA', causing the test to fail.

Backpatch to 9.2, where the failing test was added.

Per report from Svenne Krap and analysis by Jeff Janes
Modernize entab source code
Remove halt.c, improve comments, rename manual page file.
Support TB (terabyte) memory unit in GUC variables.

Patch by Simon Riggs, reviewed by Jeff Janes and me.
initdb: Add blank line before output about checksums

This maintains the logical grouping of the output better.
Further update CREATE FUNCTION documentation about argument names

More languages than SQL and PL/pgSQL actually support parameter names.
Clarify terminology standalone backend vs. single-user mode

Most of the documentation uses "single-user mode", so use that in the
code as well.  Adjust the documentation to match the new error message
wording.  Also add a documentation index entry for "single-user mode".

Based-on-patch-by: Jeff Janes <jeff.janes@gmail.com>
doc: Fix date in EPUB manifest

If there is no <date> element, the publication date for the EPUB
manifest is taken from the copyright year.  But something like
"1996-2013" is not a legal date specification.  So the EPUB output
currently fails epubcheck.

Put in a separate <date> element with the current year.  Put it in
legal.sgml, because copyright.pl already instructs to update that
manually, so it hopefully won't be missed.
Ensure no xid gaps during Hot Standby startup

In some cases with higher numbers of subtransactions
it was possible for us to incorrectly initialize
subtrans leading to complaints of missing pages.

Bug report by Sergey Konoplev
Analysis and fix by Andres Freund
Add a comment warning against use of pg_usleep() for long sleeps.

Follow-up to commit 873ab97219caabeb2f7b390268a4fe01e2b7518c, in which
I noted that WaitLatch was a better solution in the commit log message,
but neglected to add any documentation in the code.
Translation updates
ALTER TABLE ... ALTER CONSTRAINT for FKs

Allow constraint attributes to be altered,
so the default setting of NOT DEFERRABLE
can be altered to DEFERRABLE and back.

Review by Abhijit Menon-Sen
Reverting previous commit, pending investigation
of sporadic seg faults from various build farm members.
Merge branch 'master' into matview