summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
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.
2010-05-11Set per-function GUC settings during validating the function.Itagaki Takahiro
Now validators work properly even when the settings contain parameters that affect behavior of the function, like search_path. Reported by Erwin Brandstetter.
2010-05-10When adding a "target IS NOT NULL" indexqual to the plan for an index-optimizedTom Lane
MIN or MAX, we must take care to insert the added qual in a legal place among the existing indexquals, if any. The btree index AM requires the quals to appear in index-column order. We didn't have to worry about this before because "target IS NOT NULL" was just treated as a plain scan filter condition; but as of 9.0 it can be an index qual and then it has to follow the rule. Per report from Ian Barwick.
2010-05-09Suppress signed-vs-unsigned-char warning.Tom Lane
2010-05-09Fix missing static declaration for XLogRead().Tom Lane
2010-05-09Adjust comments about avoiding use of printf's %.*s.Tom Lane
My initial impression that glibc was measuring the precision in characters (which is what the Linux man page says it does) was incorrect. It does take the precision to be in bytes, but it also tries to truncate the string at a character boundary. The bottom line remains the same: it will mess up if the string is not in the encoding it expects, so we need to avoid %.*s anytime there's a significant risk of that. Previous code changes are still good, but adjust the comments to reflect this knowledge. Per research by Hernan Gonzalez.
2010-05-08Work around a subtle portability problem in use of printf %s format.Tom Lane
Depending on which spec you read, field widths and precisions in %s may be counted either in bytes or characters. Our code was assuming bytes, which is wrong at least for glibc's implementation, and in any case libc might have a different idea of the prevailing encoding than we do. Hence, for portable results we must avoid using anything more complex than just "%s" unless the string to be printed is known to be all-ASCII. This patch fixes the cases I could find, including the psql formatting failure reported by Hernan Gonzalez. In HEAD only, I also added comments to some places where it appears safe to continue using "%.*s".
2010-05-07ECPG connect routine only checked for NULL to find empty parameters, but ↵Michael Meskes
user and password can also be "".
2010-05-06On Linux, use --enable-new-dtags when specifying -rpath to linker.Tom Lane
This should allow LD_LIBRARY_PATH to work as desired. Per trouble report from Andy Colson.
2010-05-06Code page for EUC-KR is surely 51949.Itagaki Takahiro
2010-05-05Fix psql to not go into infinite recursion when expanding a variable thatTom Lane
refers to itself (directly or indirectly). Instead, print a message when recursion is detected, and don't expand the repeated reference. Per bug #5448 from Francis Markham. Back-patch to 8.0. Although the issue exists in 7.4 as well, it seems impractical to fix there because of the lack of any state stack that could be used to track active expansions.
2010-05-03Need to hold ControlFileLock while updating control file. UpdateHeikki Linnakangas
minRecoveryPoint in control file when replaying a parameter change record, to ensure that we don't allow hot standby on WAL generated without wal_level='hot_standby' after a standby restart.
2010-05-02Improve printing of XLOG_HEAP_NEWPAGE records to include the forknum.Tom Lane
2010-05-02Fix replay of XLOG_HEAP_NEWPAGE WAL records to pay attention to the forknumTom Lane
field of the WAL record. The previous coding always wrote to the main fork, resulting in data corruption if the page was meant to go into a non-default fork. At present, the only operation that can produce such WAL records is ALTER TABLE/INDEX SET TABLESPACE when executed with archive_mode = on. Data corruption would be observed on standby slaves, and could occur on the master as well if a database crash and recovery occurred after committing the ALTER and before the next checkpoint. Per report from Gordon Shannon. Back-patch to 8.4; the problem doesn't exist in earlier branches because we didn't have a concept of multiple relation forks then.
2010-05-02Update standbycheck test output with new ERROR message changes. No changesSimon Riggs
to tests and no changes in accepted server behaviour.
2010-05-02Clean up some awkward, inaccurate, and inefficient processing aroundTom Lane
MaxStandbyDelay. Use the GUC units mechanism for the value, and choose more appropriate timestamp functions for performing tests with it. Make the ps_activity manipulation in ResolveRecoveryConflictWithVirtualXIDs have behavior similar to ps_activity code elsewhere, notably not updating the display when update_process_title is off and not truncating the display contents at an arbitrarily-chosen length. Improve the docs to be explicit about what MaxStandbyDelay actually measures, viz the difference between primary and standby servers' clocks, and the possible hazards if their clocks aren't in sync.
2010-05-01Add code to InternalIpcMemoryCreate() to handle the case where shmget()Tom Lane
returns EINVAL for an existing shared memory segment. Although it's not terribly sensible, that behavior does meet the POSIX spec because EINVAL is the appropriate error code when the existing segment is smaller than the requested size, and the spec explicitly disclaims any particular ordering of error checks. Moreover, it does in fact happen on OS X and probably other BSD-derived kernels. (We were able to talk NetBSD into changing their code, but purging that behavior from the wild completely seems unlikely to happen.) We need to distinguish collision with a pre-existing segment from invalid size request in order to behave sensibly, so it's worth some extra code here to get it right. Per report from Gavin Kistner and subsequent investigation. Back-patch to all supported versions, since any of them could get used with a kernel having the debatable behavior.
2010-05-01Fix leakage of proc-related storage in plpython's inline handler.Tom Lane
Per report from Andres Freund.
2010-04-30Fix multiple memory leaks in PLy_spi_execute_fetch_result: it would leakTom Lane
memory if the result had zero rows, and also if there was any sort of error while converting the result tuples into Python data. Reported and partially fixed by Andres Freund. Back-patch to all supported versions. Note: I haven't tested the 7.4 fix. 7.4's configure check for python is so obsolete it doesn't work on my current machines :-(. The logic change is pretty straightforward though.
2010-04-30Fix a couple of places where the result of fgets() wasn't checked.Tom Lane
This is mostly to suppress compiler warnings, although in principle the cases could result in undesirable behavior. Martin Pitt
2010-04-30Fix handling of b-tree reuse WAL records when hot standby is disabled,Heikki Linnakangas
and add missing code in btree_desc for them. This fixes the bug with "tree_redo: unknown op code 208" error reported by Jaime Casanova.