1. 12 Dec, 2011 2 commits
    • Tom Lane's avatar
      Move BKP_REMOVABLE bit from individual WAL records to WAL page headers. · 2dd9322b
      Tom Lane authored
      Removing this bit from xl_info allows us to restore the old limit of four
      (not three) separate pages touched by a WAL record, which is needed for the
      upcoming SP-GiST feature, and will likely be useful elsewhere in future.
      
      When we implemented XLR_BKP_REMOVABLE in 2007, we had to do it like that
      because no special WAL-visible action was taken when starting a backup.
      However, now we force a segment switch when starting a backup, so a
      compressing WAL archiver (such as pglesslog) that uses the state shown in
      the current page header will not be fooled as to removability of backup
      blocks.  The only downside is that the archiver will not return to
      compressing mode for up to one WAL page after the backup is over, which is
      a small price to pay for getting back the extra xl_info bit.  In any case
      the archiver could look for XLOG_BACKUP_END records if it thought it was
      worth the trouble to do so.
      
      Bump XLOG_PAGE_MAGIC since this is effectively a change in WAL format.
      2dd9322b
    • Heikki Linnakangas's avatar
      Revert the behavior of inet/cidr functions to not unpack the arguments. · 8409b604
      Heikki Linnakangas authored
      I forgot to change the functions to use the PG_GETARG_INET_PP() macro,
      when I changed DatumGetInetP() to unpack the datum, like Datum*P macros
      usually do. Also, I screwed up the definition of the PG_GETARG_INET_PP()
      macro, and didn't notice because it wasn't used.
      
      This fixes the memory leak when sorting inet values, as reported
      by Jochen Erwied and debugged by Andres Freund. Backpatch to 8.3, like
      the previous patch that broke it.
      8409b604
  2. 10 Dec, 2011 3 commits
  3. 09 Dec, 2011 4 commits
  4. 07 Dec, 2011 6 commits
  5. 06 Dec, 2011 3 commits
  6. 05 Dec, 2011 3 commits
    • Bruce Momjian's avatar
      In pg_upgrade, allow tables using regclass to be upgraded because we · 0e8f6bf0
      Bruce Momjian authored
      preserve pg_class oids since PG 9.0.
      0e8f6bf0
    • Tom Lane's avatar
      Remove troublesome Asserts in cost_mergejoin(). · ff68b256
      Tom Lane authored
      While logically correct, these two Asserts could fail depending on the
      vagaries of floating-point arithmetic.  In particular, on machines with
      floating-point registers wider than standard "double" values, it was
      possible for the compiler to compare a rounded-to-double value already
      stored in memory with an unrounded long double value still in a register.
      Given the preceding checks, these assertions aren't adding much, so let's
      just get rid of them rather than try to find a compiler-proof fix.
      Per report from Pavel Stehule.
      
      Given the lack of previous complaints, and the fact that only developers
      would be likely to trip over it, I'm only going to change this in HEAD,
      even though the code has been like this for a long time.
      ff68b256
    • Peter Eisentraut's avatar
      plpython: Add SPI cursor support · 89e850e6
      Peter Eisentraut authored
      Add a function plpy.cursor that is similar to plpy.execute but uses an
      SPI cursor to avoid fetching the entire result set into memory.
      
      Jan Urbański, reviewed by Steve Singer
      89e850e6
  7. 04 Dec, 2011 3 commits
  8. 03 Dec, 2011 1 commit
  9. 02 Dec, 2011 4 commits
  10. 01 Dec, 2011 7 commits
  11. 30 Nov, 2011 4 commits
    • Tom Lane's avatar
      Update time zone data files to tzdata release 2011n. · 895d328a
      Tom Lane authored
      DST law changes in Brazil, Cuba, Fiji, Palestine, Russia, Samoa.
      Historical corrections for Alaska and British East Africa.
      895d328a
    • Robert Haas's avatar
      Improve table locking behavior in the face of current DDL. · 2ad36c4e
      Robert Haas authored
      In the previous coding, callers were faced with an awkward choice:
      look up the name, do permissions checks, and then lock the table; or
      look up the name, lock the table, and then do permissions checks.
      The first choice was wrong because the results of the name lookup
      and permissions checks might be out-of-date by the time the table
      lock was acquired, while the second allowed a user with no privileges
      to interfere with access to a table by users who do have privileges
      (e.g. if a malicious backend queues up for an AccessExclusiveLock on
      a table on which AccessShareLock is already held, further attempts
      to access the table will be blocked until the AccessExclusiveLock
      is obtained and the malicious backend's transaction rolls back).
      
      To fix, allow callers of RangeVarGetRelid() to pass a callback which
      gets executed after performing the name lookup but before acquiring
      the relation lock.  If the name lookup is retried (because
      invalidation messages are received), the callback will be re-executed
      as well, so we get the best of both worlds.  RangeVarGetRelid() is
      renamed to RangeVarGetRelidExtended(); callers not wishing to supply
      a callback can continue to invoke it as RangeVarGetRelid(), which is
      now a macro.  Since the only one caller that uses nowait = true now
      passes a callback anyway, the RangeVarGetRelid() macro defaults nowait
      as well.  The callback can also be used for supplemental locking - for
      example, REINDEX INDEX needs to acquire the table lock before the index
      lock to reduce deadlock possibilities.
      
      There's a lot more work to be done here to fix all the cases where this
      can be a problem, but this commit provides the general infrastructure
      and fixes the following specific cases: REINDEX INDEX, REINDEX TABLE,
      LOCK TABLE, and and DROP TABLE/INDEX/SEQUENCE/VIEW/FOREIGN TABLE.
      
      Per discussion with Noah Misch and Alvaro Herrera.
      2ad36c4e
    • Tom Lane's avatar
      Tweak previous patch to ensure edata->filename always gets initialized. · a87ebace
      Tom Lane authored
      On a platform that isn't supplying __FILE__, previous coding would either
      crash or give a stale result for the filename string.  Not sure how likely
      that is, but the original code catered for it, so let's keep doing so.
      a87ebace
    • Peter Eisentraut's avatar
      Strip file names reported in error messages in vpath builds · dd136052
      Peter Eisentraut authored
      In vpath builds, the __FILE__ macro that is used in verbose error
      reports contains the full absolute file name, which makes the error
      messages excessively verbose.  So keep only the base name, thus
      matching the behavior of non-vpath builds.
      dd136052