1. 29 Apr, 2013 3 commits
    • Kevin Grittner's avatar
      Ensure ANALYZE phase is not skipped because of canceled truncate. · 5fc89376
      Kevin Grittner authored
      Patch b19e4250 attempted to
      preserve existing behavior regarding statistics generation in the
      case that a truncation attempt was canceled due to lock conflicts.
      It failed to do this accurately in two regards: (1) autovacuum had
      previously generated statistics if the truncate attempt failed to
      initially get the lock rather than having started the attempt, and
      (2) the VACUUM ANALYZE command had always generated statistics.
      
      Both of these changes were unintended, and are reverted by this
      patch.  On review, there seems to be consensus that the previous
      failure to generate statistics when the truncate was terminated
      was more an unfortunate consequence of how that effort was
      previously terminated than a feature we want to keep; so this
      patch generates statistics even when an autovacuum truncation
      attempt terminates early.  Another unintended change which is kept
      on the basis that it is an improvement is that when a VACUUM
      command is truncating, it will the new heuristic for avoiding
      blocking other processes, rather than keeping an
      AccessExclusiveLock on the table for however long the truncation
      takes.
      
      Per multiple reports, with some renaming per patch by Jeff Janes.
      
      Backpatch to 9.0, where problem was created.
      5fc89376
    • Robert Haas's avatar
      Attempt to fix error recovery in COPY BOTH mode. · 91fa8532
      Robert Haas authored
      Previously, libpq and the backend had opposite ideas about whether
      it was necessary for the client to send a CopyDone message after
      receiving an ErrorResponse, making it impossible to cleanly exit
      COPY BOTH mode.  Fix libpq so that works correctly, adopting the
      backend's notion that an ErrorResponse kills the copy in both
      directions.
      
      Adjust receivelog.c to avoid a degradation in the quality of the
      resulting error messages.  libpqwalreceiver.c is already doing
      the right thing, so no adjustment needed there.
      
      Add an explicit statement to the documentation explaining how
      this part of the protocol is supposed to work, in the hopes of
      avoiding future confusion in this area.
      
      Since the consequences of all this confusion are very limited,
      especially in the back-branches where no client ever attempts
      to exit COPY BOTH mode without closing the connection entirely,
      no back-patch.
      91fa8532
    • Simon Riggs's avatar
      Introduce new page checksum algorithm and module. · 43e7a668
      Simon Riggs authored
      Isolate checksum calculation to its own module, so that bufpage
      knows little if anything about the details of the calculation.
      
      This implementation is a modified FNV-1a hash checksum, details
      of which are given in the new checksum.c header comments.
      
      Basic implementation only, so we fix the output value.
      
      Later related commits will add version numbers to pg_control,
      compiler optimization flags and memory barriers.
      
      Ants Aasma, reviewed by Jeff Davis and Simon Riggs
      43e7a668
  2. 28 Apr, 2013 3 commits
    • Tom Lane's avatar
      Editorialize a bit on new ProcessUtility() API. · f8db76e8
      Tom Lane authored
      Choose a saner ordering of parameters (adding a new input param after
      the output params seemed a bit random), update the function's header
      comment to match reality (cmon folks, is this really that hard?),
      get rid of useless and sloppily-defined distinction between
      PROCESS_UTILITY_SUBCOMMAND and PROCESS_UTILITY_GENERATED.
      f8db76e8
    • Tom Lane's avatar
      Fix unsafe event-trigger coding in ProcessUtility(). · 5525e6c4
      Tom Lane authored
      We mustn't run any of the event-trigger support code when handling
      utility statements like START TRANSACTION or ABORT, because that code
      may need to refresh event-trigger cache data, which requires being
      inside a valid transaction.  (This mistake explains the consistent
      build failures exhibited by the CLOBBER_CACHE_ALWAYS buildfarm members,
      as well as some irreproducible failures on other members.)
      
      The least messy fix seems to be to break standard_ProcessUtility into two
      functions, one that handles all the statements not supported by event
      triggers, and one that contains the event-trigger support code and handles
      the statements that are supported by event triggers.
      
      This change also fixes several inconsistencies, such as four cases where
      support had been installed for "ddl_event_start" but not "ddl_event_end"
      triggers, plus the fact that InvokeDDLCommandEventTriggersIfSupported()
      paid no mind to isCompleteQuery.
      
      Dimitri Fontaine and Tom Lane
      5525e6c4
    • Peter Eisentraut's avatar
      pg_dump: Improve message formatting · bbb4db4e
      Peter Eisentraut authored
      bbb4db4e
  3. 27 Apr, 2013 3 commits
    • Tom Lane's avatar
      Incidental cleanup of matviews code. · 5194024d
      Tom Lane authored
      Move checking for unscannable matviews into ExecOpenScanRelation, which is
      a better place for it first because the open relation is already available
      (saving a relcache lookup cycle), and second because this eliminates the
      problem of telling the difference between rangetable entries that will or
      will not be scanned by the query.  In particular we can get rid of the
      not-terribly-well-thought-out-or-implemented isResultRel field that the
      initial matviews patch added to RangeTblEntry.
      
      Also get rid of entirely unnecessary scannability check in the rewriter,
      and a bogus decision about whether RefreshMatViewStmt requires a parse-time
      snapshot.
      
      catversion bump due to removal of a RangeTblEntry field, which changes
      stored rules.
      5194024d
    • Peter Eisentraut's avatar
      Improve message about failed transaction log archiving · f5d576c6
      Peter Eisentraut authored
      The old phrasing appeared to imply that the failure was terminal.
      Improve that by indicating that archiving will be tried again later.
      f5d576c6
    • Peter Eisentraut's avatar
      Update config.guess and config.sub · b53b603c
      Peter Eisentraut authored
      b53b603c
  4. 26 Apr, 2013 3 commits
    • Tom Lane's avatar
      Fix collation assignment for aggregates with ORDER BY. · 41a2760f
      Tom Lane authored
      ORDER BY expressions were being treated the same as regular aggregate
      arguments for purposes of collation determination, but really they should
      not affect the aggregate's collation at all; only collations of the
      aggregate's regular arguments should affect it.
      
      In many cases this mistake would lead to incorrectly throwing a "collation
      conflict" error; but in some cases the corrected code will silently assign
      a different collation to the aggregate than before, for example
      	agg(foo ORDER BY bar COLLATE "x")
      which will now use foo's collation rather than "x" for the aggregate.
      Given this risk and the lack of field complaints about the issue, it
      doesn't seem prudent to back-patch.
      
      In passing, rearrange code in assign_collations_walker so that we don't
      need multiple copies of the standard logic for computing collation of a
      node with children.  (Previously, CaseExpr duplicated the standard logic,
      and we would have needed a third copy for Aggref without this change.)
      
      Andrew Gierth and David Fetter
      41a2760f
    • Joe Conway's avatar
      Ensure that user created rows in extension tables get dumped if the table is... · b42ea798
      Joe Conway authored
      Ensure that user created rows in extension tables get dumped if the table is explicitly requested, either with a -t/--table switch of the table itself, or by -n/--schema switch of the schema containing the extension table. Patch reviewed by Vibhor Kumar and Dimitri Fontaine.
      
      Backpatched to 9.1 when the extension management facility was added.
      b42ea798
    • Robert Haas's avatar
      libpq: Fix a few bits that didn't get the memo about COPY BOTH. · 5eb7c4d3
      Robert Haas authored
      There's probably no real bug here at present, so not backpatching.
      But it seems good to make these bits consistent with the rest of
      libpq, so as to avoid future surprises.
      
      Patch by me.  Review by Tom Lane.
      5eb7c4d3
  5. 25 Apr, 2013 5 commits
  6. 24 Apr, 2013 4 commits
    • Heikki Linnakangas's avatar
      Add missing #include. · 0c1a160a
      Heikki Linnakangas authored
      On non-Windows systems, sys/time.h was pulled in by portability/instr_time.h,
      which pulled in time.h. We certainly should include time.h directly, since
      we're using time(2), but the indirect include masked the problem on most
      platforms.
      
      Andres Freund
      0c1a160a
    • Kevin Grittner's avatar
      Fix assertion failure for REFRESH MATERIALIZED VIEW in PL. · 63e20041
      Kevin Grittner authored
      This was due to incomplete implementation of rowcount reporting
      for RMV, which was due to initial waffling on whether it should
      be provided.  It seems unlikely to be a useful or universally
      available  number as more sophisticated techniques for maintaining
      matviews are added, so remove the partial support rather than
      completing it.
      
      Per report of Jeevan Chalke, but with a different fix
      63e20041
    • Simon Riggs's avatar
      Make fast promotion the default promotion mode. · 2317a633
      Simon Riggs authored
      Continue to allow a request for synchronous
      checkpoints as a mechanism in case of problems.
      2317a633
    • Bruce Momjian's avatar
      9.3 release notes: adjustments per Alvaro · 173c252b
      Bruce Momjian authored
      173c252b
  7. 23 Apr, 2013 2 commits
  8. 22 Apr, 2013 8 commits
  9. 21 Apr, 2013 5 commits
  10. 20 Apr, 2013 4 commits
    • Bruce Momjian's avatar
      More 9.3 release note reorderings · f0922cbd
      Bruce Momjian authored
      f0922cbd
    • Bruce Momjian's avatar
      488eb905
    • Tom Lane's avatar
      Fix longstanding race condition in plancache.c. · ac63dca6
      Tom Lane authored
      When creating or manipulating a cached plan for a transaction control
      command (particularly ROLLBACK), we must not perform any catalog accesses,
      since we might be in an aborted transaction.  However, plancache.c busily
      saved or examined the search_path for every cached plan.  If we were
      unlucky enough to do this at a moment where the path's expansion into
      schema OIDs wasn't already cached, we'd do some catalog accesses; and with
      some more bad luck such as an ill-timed signal arrival, that could lead to
      crashes or Assert failures, as exhibited in bug #8095 from Nachiket Vaidya.
      Fortunately, there's no real need to consider the search path for such
      commands, so we can just skip the relevant steps when the subject statement
      is a TransactionStmt.  This is somewhat related to bug #5269, though the
      failure happens during initial cached-plan creation rather than
      revalidation.
      
      This bug has been there since the plan cache was invented, so back-patch
      to all supported branches.
      ac63dca6
    • Bruce Momjian's avatar
      Reorder some 9.3 release item entries · 61b96234
      Bruce Momjian authored
      More to go.
      61b96234