1. 16 Jun, 2011 2 commits
    • Simon Riggs's avatar
      Respect Hot Standby controls while recycling btree index pages. · 758bd2a4
      Simon Riggs authored
      Btree pages were recycled after VACUUM deletes all records on a
      page and then a subsequent VACUUM occurs after the RecentXmin
      horizon is reached. Using RecentXmin meant that we did not respond
      correctly to the user controls provide to avoid Hot Standby
      conflicts and so spurious conflicts could be generated in some
      workload combinations. We now reuse pages only when we reach
      RecentGlobalXmin, which can be much later in the presence of long
      running queries and is also controlled by vacuum_defer_cleanup_age
      and hot_standby_feedback.
      
      Noah Misch and Simon Riggs
      758bd2a4
    • Tom Lane's avatar
      Use single quotes in preference to double quotes for protecting pathnames. · 1568fa75
      Tom Lane authored
      Per recommendation from Peter.  Neither choice is bulletproof, but this
      is the existing style and it does help prevent unexpected environment
      variable substitution.
      1568fa75
  2. 15 Jun, 2011 6 commits
    • Tom Lane's avatar
      Rework parsing of ConstraintAttributeSpec to improve NOT VALID handling. · e1ccaff6
      Tom Lane authored
      The initial commit of the ALTER TABLE ADD FOREIGN KEY NOT VALID feature
      failed to support labeling such constraints as deferrable.  The best fix
      for this seems to be to fold NOT VALID into ConstraintAttributeSpec.
      That's a bit more general than the documented syntax, but it allows
      better-targeted syntax error messages.
      
      In addition, do some mostly-but-not-entirely-cosmetic code review for
      the whole NOT VALID patch.
      e1ccaff6
    • Bruce Momjian's avatar
    • Tom Lane's avatar
      Fix failure to account for memory used by tuplestore_putvalues(). · 10db3de6
      Tom Lane authored
      This oversight could result in a tuplestore using much more than the
      intended amount of memory.  It would only happen in a code path that loaded
      a tuplestore via tuplestore_putvalues(), and many of those won't emit huge
      amounts of data; but cases such as holdable cursors and plpgsql's RETURN
      NEXT command could have the problem.  The fix ensures that the tuplestore
      will switch to write-to-disk mode when it overruns work_mem.
      
      The potential overrun was finite, because we would still count the space
      used by the tuple pointer array, so the tuplestore code would eventually
      flip into write-to-disk mode anyway.  When storing wide tuples we would
      go far past the expected work_mem usage before that happened; but this
      may account for the lack of prior reports.
      
      Back-patch to 8.4, where tuplestore_putvalues was introduced.
      
      Per bug #6061 from Yann Delorme.
      10db3de6
    • Tom Lane's avatar
      Fix oversights in pg_basebackup's -z (compression) option. · 31156ce8
      Tom Lane authored
      The short-form -z switch didn't work, for lack of telling getopt_long
      about it; and even if specified long-form, it failed to do anything,
      because the various tests elsewhere in the file would take
      Z_DEFAULT_COMPRESSION (which is -1) as meaning "don't compress".
      
      Per bug #6060 from Shigehiro Honda, though I editorialized on his patch
      a bit.
      31156ce8
    • Heikki Linnakangas's avatar
      The rolled-back flag on serializable xacts was pointless and redundant with · 264a6b12
      Heikki Linnakangas authored
      the marked-for-death flag. It was only set for a fleeting moment while a
      transaction was being cleaned up at rollback. All the places that checked
      for the rolled-back flag should also check the marked-for-death flag, as
      both flags mean that the transaction will roll back. I also renamed the
      marked-for-death into "doomed", which is a lot shorter name.
      264a6b12
    • Heikki Linnakangas's avatar
      Make non-MVCC snapshots exempt from predicate locking. Scans with non-MVCC · 0a0e2b52
      Heikki Linnakangas authored
      snapshots, like in REINDEX, are basically non-transactional operations. The
      DDL operation itself might participate in SSI, but there's separate
      functions for that.
      
      Kevin Grittner and Dan Ports, with some changes by me.
      0a0e2b52
  3. 14 Jun, 2011 14 commits
  4. 13 Jun, 2011 9 commits
  5. 12 Jun, 2011 4 commits
  6. 11 Jun, 2011 2 commits
  7. 10 Jun, 2011 3 commits
    • Tom Lane's avatar
      Work around gcc 4.6.0 bug that breaks WAL replay. · c2ba0121
      Tom Lane authored
      ReadRecord's habit of using both direct references to tmpRecPtr and
      references to *RecPtr (which is pointing at tmpRecPtr) triggers an
      optimization bug in gcc 4.6.0, which apparently has forgotten about
      aliasing rules.  Avoid the compiler bug, and make the code more readable
      to boot, by getting rid of the direct references.  Improve the comments
      while at it.
      
      Back-patch to all supported versions, in case they get built with 4.6.0.
      
      Tom Lane, with some cosmetic suggestions from Alex Hunsaker
      c2ba0121
    • Heikki Linnakangas's avatar
      Fix locking while setting flags in MySerializableXact. · cb2d158c
      Heikki Linnakangas authored
      Even if a flag is modified only by the backend owning the transaction, it's
      not safe to modify it without a lock. Another backend might be setting or
      clearing a different flag in the flags field concurrently, and that
      operation might be lost because setting or clearing a bit in a word is not
      atomic.
      
      Make did-write flag a simple backend-private boolean variable, because it
      was only set or tested in the owning backend (except when committing a
      prepared transaction, but it's not worthwhile to optimize for the case of a
      read-only prepared transaction). This also eliminates the need to add
      locking where that flag is set.
      
      Also, set the did-write flag when doing DDL operations like DROP TABLE or
      TRUNCATE -- that was missed earlier.
      cb2d158c
    • Alvaro Herrera's avatar
      Add comment about pg_ctl stop · d69149ed
      Alvaro Herrera authored
      d69149ed