1. 19 Jun, 2012 4 commits
  2. 18 Jun, 2012 6 commits
    • Tom Lane's avatar
      Allow ON UPDATE/DELETE SET DEFAULT plans to be cached. · e8c9fd5f
      Tom Lane authored
      Once upon a time, somebody was worried that cached RI plans wouldn't get
      remade with new default values after ALTER TABLE ... SET DEFAULT, so they
      didn't allow caching of plans for ON UPDATE/DELETE SET DEFAULT actions.
      That time is long gone, though (and even at the time I doubt this was the
      greatest hazard posed by ALTER TABLE...).  So allow these triggers to cache
      their plans just like the others.
      
      The cache_plan argument to ri_PlanCheck is now vestigial, since there
      are no callers that don't pass "true"; but I left it alone in case there
      is any future need for it.
      e8c9fd5f
    • Tom Lane's avatar
      Remove derived fields from RI_QueryKey, and do a bit of other cleanup. · 03a5ba24
      Tom Lane authored
      We really only need the foreign key constraint's OID and the query type
      code to uniquely identify each plan we are caching for FK checks.  The
      other stuff that was in the struct had no business being used as part of
      a hash key, and was all just being copied from struct RI_ConstraintInfo
      anyway.  Get rid of the unnecessary fields, and readjust various function
      APIs to make them use RI_ConstraintInfo not RI_QueryKey as info source.
      
      I'd be surprised if this makes any measurable performance difference,
      but it certainly feels cleaner.
      03a5ba24
    • Peter Eisentraut's avatar
      e1e97e93
    • Tom Lane's avatar
      Update SQL spec references in ri_triggers code to match SQL:2008. · f9429746
      Tom Lane authored
      Now that what we're implementing isn't SQL92, we probably shouldn't cite
      chapter and verse in that spec anymore.  Also fix some comments that
      talked about MATCH FULL but in fact were in code that's also used for
      MATCH SIMPLE.
      
      No code changes in this commit, just comments.
      f9429746
    • Tom Lane's avatar
      Change ON UPDATE SET NULL/SET DEFAULT referential actions to meet SQL spec. · c75be2ad
      Tom Lane authored
      Previously, when executing an ON UPDATE SET NULL or SET DEFAULT action for
      a multicolumn MATCH SIMPLE foreign key constraint, we would set only those
      referencing columns corresponding to referenced columns that were changed.
      This is what the SQL92 standard said to do --- but more recent versions
      of the standard say that all referencing columns should be set to null or
      their default values, no matter exactly which referenced columns changed.
      At least for SET DEFAULT, that is clearly saner behavior.  It's somewhat
      debatable whether it's an improvement for SET NULL, but it appears that
      other RDBMS systems read the spec this way.  So let's do it like that.
      
      This is a release-notable behavioral change, although considering that
      our documentation already implied it was done this way, the lack of
      complaints suggests few people use such cases.
      c75be2ad
    • Tom Lane's avatar
      Refer to the default foreign key match style as MATCH SIMPLE internally. · f5297bdf
      Tom Lane authored
      Previously we followed the SQL92 wording, "MATCH <unspecified>", but since
      SQL99 there's been a less awkward way to refer to the default style.
      
      In addition to the code changes, pg_constraint.confmatchtype now stores
      this match style as 's' (SIMPLE) rather than 'u' (UNSPECIFIED).  This
      doesn't affect pg_dump or psql because they use pg_get_constraintdef()
      to reconstruct foreign key definitions.  But other client-side code might
      examine that column directly, so this change will have to be marked as
      an incompatibility in the 9.3 release notes.
      f5297bdf
  3. 17 Jun, 2012 3 commits
    • Peter Eisentraut's avatar
      Make documentation of --help and --version options more consistent · bb7520cc
      Peter Eisentraut authored
      Before, some places didn't document the short options (-? and -V),
      some documented both, some documented nothing, and they were listed in
      various orders.  Now this is hopefully more consistent and complete.
      bb7520cc
    • Tom Lane's avatar
      Fix stats collector to recover nicely when system clock goes backwards. · 9e18eacb
      Tom Lane authored
      Formerly, if the system clock went backwards, the stats collector would
      fail to update the stats file any more until the clock reading again
      exceeds whatever timestamp was last written into the stats file.  Such
      glitches in the clock's behavior are not terribly unlikely on machines
      not using NTP.  Such a scenario has been observed to cause regression test
      failures in the buildfarm, and it could have bad effects on the behavior
      of autovacuum, so it seems prudent to install some defenses.
      
      We could directly detect the clock going backwards by adding
      GetCurrentTimestamp calls in the stats collector's main loop, but that
      would hurt performance on platforms where GetCurrentTimestamp is expensive.
      To minimize the performance hit in normal cases, adopt a more complicated
      scheme wherein backends check for clock skew when reading the stats file,
      and if they see it, signal the stats collector by sending an extra stats
      inquiry message.  The stats collector does an extra GetCurrentTimestamp
      only when it receives an inquiry with an apparently out-of-order
      timestamp.
      
      To avoid unnecessary GetCurrentTimestamp calls, expand the inquiry messages
      to carry the backend's current clock reading as well as its stats cutoff
      time.  The latter, being intentionally slightly in-the-past, would trigger
      more clock rechecks than we need if it were used for this purpose.
      
      We might want to backpatch this change at some point, but let's let it
      shake out in the buildfarm for awhile first.
      9e18eacb
    • Magnus Hagander's avatar
      Reorder basebackup options, to list pg_basebackup first · 920febda
      Magnus Hagander authored
      Since this is the easy way of doing it, it should be listed first. All
      the old information is retained for those who want the more advanced way.
      
      Also adds a subheading for compressing logs, that seems to have been missing
      920febda
  4. 16 Jun, 2012 3 commits
  5. 15 Jun, 2012 2 commits
  6. 14 Jun, 2012 13 commits
  7. 13 Jun, 2012 8 commits
    • Tom Lane's avatar
      Revisit error message details for JSON input parsing. · 80edfd76
      Tom Lane authored
      Instead of identifying error locations only by line number (which could
      be entirely unhelpful with long input lines), provide a fragment of the
      input text too, placing this info in a new CONTEXT entry.  Make the
      error detail messages conform more closely to style guidelines, fix
      failure to expose some of them for translation, ensure compiler can
      check formats against supplied parameters.
      80edfd76
    • Tom Lane's avatar
      Remove release note entry for reverted patch. · 0f0fba17
      Tom Lane authored
      0f0fba17
    • Tom Lane's avatar
      Revert "Reduce checkpoints and WAL traffic on low activity database server" · b8b69d89
      Tom Lane authored
      This reverts commit 18fb9d8d.  Per
      discussion, it does not seem like a good idea to allow committed changes to
      go un-checkpointed indefinitely, as could happen in a low-traffic server;
      that makes us entirely reliant on the WAL stream with no redundancy that
      might aid data recovery in case of disk failure.
      
      This re-introduces the original problem of hot-standby setups generating a
      small continuing stream of WAL traffic even when idle, but there are other
      ways to address that without compromising crash recovery, so we'll revisit
      that issue in a future release cycle.
      b8b69d89
    • Tom Lane's avatar
      Fix description of SQL-standard meaning of CREATE LOCAL TEMP TABLE. · 8b23db94
      Tom Lane authored
      I had this slightly wrong, as noted by Noah Misch.
      8b23db94
    • Tom Lane's avatar
      Deprecate use of GLOBAL and LOCAL in temp table creation. · c3bc76bd
      Tom Lane authored
      Aside from adjusting the documentation to say that these are deprecated,
      we now report a warning (not an error) for use of GLOBAL, since it seems
      fairly likely that we might change that to request SQL-spec-compliant temp
      table behavior in the foreseeable future.  Although our handling of LOCAL
      is equally nonstandard, there is no evident interest in ever implementing
      SQL modules, and furthermore some other products interpret LOCAL as
      behaving the same way we do.  So no expectation of change and no warning
      for LOCAL; but it still seems a good idea to deprecate writing it.
      
      Noah Misch
      c3bc76bd
    • Tom Lane's avatar
      Support Linux's oom_score_adj API as well as the older oom_adj API. · 93f4d7f8
      Tom Lane authored
      The simplest way to handle this is just to copy-and-paste the relevant
      code block in fork_process.c, so that's what I did. (It's possible that
      something more complicated would be useful to packagers who want to work
      with either the old or the new API; but at this point the number of such
      people is rapidly approaching zero, so let's just get the minimal thing
      done.)  Update relevant documentation as well.
      93f4d7f8
    • Bruce Momjian's avatar
      In pg_upgrade, verify that the install user has the same oid on both · b9212e37
      Bruce Momjian authored
      clusters, and make sure the new cluster has no additional users.
      
      Backpatch to 9.1.
      b9212e37
    • Peter Eisentraut's avatar
      Improve documentation of postgres -C option · c0a6f9c8
      Peter Eisentraut authored
      Clarify help (s/return/print/), and explain that this option is for
      use by other programs, not for user-facing use (it does not print
      units).
      c0a6f9c8
  8. 12 Jun, 2012 1 commit