summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2010-05-27Avoid starting walreceiver in states where it shouldn't be running.Robert Haas
In particular, it's bad to start walreceiver when in state PM_WAIT_BACKENDS, because we have no provision to kill walreceiver when in that state. Fujii Masao
2010-05-27Adjust comment to reflect that we now have Hot Standby. Pointed out byHeikki Linnakangas
Robert Haas.
2010-05-26Thinko in previous commit: ensure that MAX_SEND_SIZE is always greaterHeikki Linnakangas
than XLOG_BLCKSZ, by defining it as 16 * XLOG_BLCKSZ rather than directly as 128k bytes.
2010-05-26In walsender, don't sleep if there's outstanding WAL waiting to be sent,Heikki Linnakangas
otherwise we effectively rate-limit the streaming as pointed out by Simon Riggs. Also, send the WAL in smaller chunks, to respond to signals more promptly.
2010-05-26Rearrange libpq's SSL initialization to simplify it and make it handle someTom Lane
additional cases correctly. The original coding failed to load additional (chain) certificates from the client cert file, meaning that indirectly signed client certificates didn't work unless one hacked the server's root.crt file to include intermediate CAs (not the desired approach). Another problem was that everything got loaded into the shared SSL_context object, which meant that concurrent connections trying to use different sslcert settings could well fail due to conflicting over the single available slot for a keyed certificate. To fix, get rid of the use of SSL_CTX_set_client_cert_cb(), which is deprecated anyway in the OpenSSL documentation, and instead just unconditionally load the client cert and private key during connection initialization. This lets us use SSL_CTX_use_certificate_chain_file(), which does the right thing with additional certs, and is lots simpler than the previous hacking about with BIO-level access. A small disadvantage is that we have to load the primary client cert a second time with SSL_use_certificate_file, so that that one ends up in the correct slot within the connection's SSL object where it can get paired with the key. Given the other overhead of making an SSL connection, that doesn't seem worth worrying about. Per discussion ensuing from bug #5468.
2010-05-26Fix bogus error message for SSL-cert authentication, due to lack ofTom Lane
a uaCert entry in auth_failed(). Put the switch entries into a sane order, namely the one the enum is declared in.
2010-05-26HS Defer buffer pin deadlock check until deadlock_timeout has expired.Simon Riggs
During Hot Standby we need to check for buffer pin deadlocks when the Startup process begins to wait, in case it never wakes up again. We previously made the deadlock check immediately on the basis it was cheap, though clearer thinking and prima facie evidence shows that was too simple. Refactor existing code to make it easy to add in deferral of deadlock check until deadlock_timeout allowing a good reduction in deadlock checks since far few buffer pins are held for that duration. It's worth doing anyway, though major goal is to prevent further reports of context switching with high numbers of users on occasional tests.
2010-05-26Fix psql help: \da+ is same as \da, but \daS is not.Robert Haas
Noted by Stephen Frost.
2010-05-26The message style police pay a visit to hba.c.Tom Lane
2010-05-26Minor editorialization for be-secure.c: fix comments and some formattingTom Lane
infelicities.
2010-05-26Tell openssl to include the names of the root certs the server trusts inTom Lane
requests for client certs. This lets a client with a keystore select the appropriate client certificate to send. In particular, this is necessary to get Java clients to work in all but the most trivial configurations. Per discussion of bug #5468. Craig Ringer
2010-05-26More fixes for shutdown during recovery.Robert Haas
1. If we receive a fast shutdown request while in the PM_STARTUP state, process it just as we would in PM_RECOVERY, PM_HOT_STANDBY, or PM_RUN. Without this change, an early fast shutdown followed by Hot Standby causes the database to get stuck in a state where a shutdown is pending (so no new connections are allowed) but the shutdown request is never processed unless we end Hot Standby and enter normal running. 2. Avoid removing the backup label file when a smart or fast shutdown occurs during recovery. It makes sense to do this once we've reached normal running, since we must be taking a backup which now won't be valid. But during recovery we must be recovering from a previously taken backup, and any backup label file is needed to restart recovery from the right place. Fujii Masao and Robert Haas
2010-05-25Add missing newlines to some SSL-related error messages. Noted while testing.Tom Lane
2010-05-25Fix oversight in construction of sort/unique plans for UniquePaths.Tom Lane
If the original IN operator is cross-type, for example int8 = int4, we need to use int4 < int4 to sort the inner data and int4 = int4 to unique-ify it. We got the first part of that right, but tried to use the original IN operator for the equality checks. Per bug #5472 from Vlad Romascanu. Backpatch to 8.4, where the bug was introduced by the patch that unified SortClause and GroupClause. I was able to take out a whole lot of on-the-fly calls of get_equality_op_for_ordering_op(), but failed to realize that I needed to put one back in right here :-(
2010-05-25Replace self written 'long long int' configure test by standard ↵Michael Meskes
'AC_TYPE_LONG_LONG_INT' macro call.
2010-05-25Added a configure test for "long long" datatypes. So far this is only used ↵Michael Meskes
in ecpg and replaces the old test that was kind of hackish.
2010-05-23Fix oversight in join removal patch: we have to delete the removed relationTom Lane
from SpecialJoinInfo relid sets as well. Per example from Vaclav Novotny.
2010-05-21Unbreak \h; can't do strlen(NULL).Robert Haas
This was broken by the following commmit. Although the original commit was backpatched all the way to 7.4, this particular bug exists only in the version applied to HEAD. http://archives.postgresql.org/pgsql-committers/2010-05/msg00058.php
2010-05-20Ecpg now accepts "long long" datatypes even if "long" is 64bit wide. This ↵Michael Meskes
used to cover the equally long "long long" type. This patch closes bug #5464.
2010-05-20Change the "N. Central Asia Standard Time" timezone to map toMagnus Hagander
Asia/Novosibirsk on Windows. Microsoft changed the behaviour of this zone in the timezone update from KB976098. The zones differ in handling of DST, and the old zone was just removed. Noted by Dmitry Funk
2010-05-18Fix regression tests to match error message changeAndrew Dunstan
2010-05-17Follow up a visit from the style police.Andrew Dunstan
2010-05-15Ensure that pg_restore -l will output DATABASE entries whether or not -CTom Lane
is specified. Per bug report from Russell Smith and ensuing discussion. Since this is a corner case behavioral change, I'm going to be conservative and not back-patch it. In passing, also rename the RestoreOptions field for the -C switch to something less generic than "create".
2010-05-15Rename PM_RECOVERY_CONSISTENT and PMSIGNAL_RECOVERY_CONSISTENT.Robert Haas
The new names PM_HOT_STANDBY and PMSIGNAL_BEGIN_HOT_STANDBY more accurately reflect their actual function.
2010-05-15Spell __NetBSD__ the same way everywhere. Per Giles Lean.Tom Lane
2010-05-15Use __bsdi__ consistently.Bruce Momjian
2010-05-15Fix bug in processing of checkpoint time for max_standby_delay. LatestSimon Riggs
log time was incorrectly set, typically leading to dates in the past, which would cause more cancellations in Hot Standby on a quiet server.
2010-05-14We now accept read-only connections in state PM_RECOVERY_CONSISTENT.Robert Haas
2010-05-14Remove CRs.Itagaki Takahiro
2010-05-14Add many new Asserts in code and fix simple bug that slipped throughSimon Riggs
without them, related to previous commit. Report by Bruce Momjian.
2010-05-13Fix up lame idea of not using autoconf to determine if platform has scandir().Tom Lane
Should fix buildfarm failures.
2010-05-13Fix MSVC builds for recent plperl changes. Go back to version 8.2, which isAndrew Dunstan
where we started supporting MSVC builds. Security: CVE-2010-1169
2010-05-13Prevent PL/Tcl from loading the "unknown" module from pltcl_modules unlessTom Lane
that is a regular table or view owned by a superuser. This prevents a trojan horse attack whereby any unprivileged SQL user could create such a table and insert code into it that would then get executed in other users' sessions whenever they call pltcl functions. Worse yet, because the code was automatically loaded into both the "normal" and "safe" interpreters at first use, the attacker could execute unrestricted Tcl code in the "normal" interpreter without there being any pltclu functions anywhere, or indeed anyone else using pltcl at all: installing pltcl is sufficient to open the hole. Change the initialization logic so that the "unknown" code is only loaded into an interpreter when the interpreter is first really used. (That doesn't add any additional security in this particular context, but it seems a prudent change, and anyway the former behavior violated the principle of least astonishment.) Security: CVE-2010-1170
2010-05-13Abandon the use of Perl's Safe.pm to enforce restrictions in plperl, as it isAndrew Dunstan
fundamentally insecure. Instead apply an opmask to the whole interpreter that imposes restrictions on unsafe operations. These restrictions are much harder to subvert than is Safe.pm, since there is no container to be broken out of. Backported to release 7.4. In releases 7.4, 8.0 and 8.1 this also includes the necessary backporting of the two interpreters model for plperl and plperlu adopted in release 8.2. In versions 8.0 and up, the use of Perl's POSIX module to undo its locale mangling on Windows has become insecure with these changes, so it is replaced by our own routine, which is also faster. Nice side effects of the changes include that it is now possible to use perl's "strict" pragma in a natural way in plperl, and that perl's $a and $b variables now work as expected in sort routines, and that function compilation is significantly faster. Tim Bunce and Andrew Dunstan, with reviews from Alex Hunsaker and Alexey Klyukin. Security: CVE-2010-1169
2010-05-13Translation updatePeter Eisentraut
2010-05-13Properly support multi-line entires (such as OBJS=) when buildingMagnus Hagander
PROGRAM, not just MODULE, in contrib.
2010-05-13Avoid error from mkdir if no languages are to be installedPeter Eisentraut
mkinstalldirs used to handle no arguments, but mkdir doesn't. Also remove the .SILENT setting, that was previously removed from Makefile.global as well.
2010-05-13Add missing library and include support for pg_upgrade to MSVC build system.Andrew Dunstan
2010-05-13Fix vpath installation from distribution tarball (bug #5447)Peter Eisentraut
2010-05-13Ensure that top level aborts call XLogSetAsyncCommit(). Not doingSimon Riggs
so simply leads to data waiting in wal_buffers which then causes later commits to potentially do emergency writes and for all forms of replication to be potentially delayed without need or benefit. Issue pointed out exactly by Fujii Masao, following bug report by Robert Haas on a separate though related topic.
2010-05-13Cleanup initialization of Hot Standby. Clarify working with reanalysisSimon Riggs
of requirements and documentation on LogStandbySnapshot(). Fixes two minor bugs reported by Tom Lane that would lead to an incorrect snapshot after transaction wraparound. Also fix two other problems discovered that would give incorrect snapshots in certain cases. ProcArrayApplyRecoveryInfo() substantially rewritten. Some minor refactoring of xact_redo_apply() and ExpireTreeKnownAssignedTransactionIds().
2010-05-12Update comment about why postmaster doesn't get an icon.Bruce Momjian
2010-05-12Remove Makefile PGFILEDESC tag that the postmaster is an executable.Bruce Momjian
2010-05-12Give most recovery conflict errors a retryable error code. From recentSimon Riggs
requests and discussions with Yeb Havinga and Kevin Grittner.
2010-05-12Add PGFILEDESC description to Makefiles for all /contrib executables.Bruce Momjian
Add PGAPPICON to all executable makefiles.
2010-05-11Update time zone data files to tzdata release 2010j: DST law changes inTom Lane
Argentina, Australian Antarctic, Bangladesh, Mexico, Morocco, Pakistan, Palestine, Russia, Syria, Tunisia. Historical corrections for Taiwan.
2010-05-11Add PKST to the default set of timezone abbreviations.Tom Lane
Per discussion, if we have PKT in there then PKST should be too. Also, fix mistaken claim that these abbrevs are not known to zic.
2010-05-11Change typedef for rb_appendator to avoid conflict with C++ reserved words.Robert Haas
Fixes a complaint from src/tools/pginclude/cpluspluscheck reported by Peter Eisentraut.
2010-05-11Cause the archiver process to adopt new postgresql.conf settings (particularlyTom Lane
archive_command) as soon as possible, namely just before issuing a new call of archive_command, even when there is a backlog of files to be archived. The original coding would only absorb new settings after clearing the backlog and returning to the outer loop. Per discussion. Back-patch to 8.3. The logic in prior versions is a bit different and it doesn't seem worth taking any risks of breaking it.
2010-05-11Fix incorrect patch that removed permission checks on inheritance childTom Lane
tables --- the parent table no longer got checked, either. Per bug #5458 from Takahiro Itagaki.