1. 09 Mar, 2014 1 commit
  2. 08 Mar, 2014 7 commits
  3. 07 Mar, 2014 8 commits
    • Tom Lane's avatar
      Remove unportable use of anonymous unions from reorderbuffer.h. · ea177a3b
      Tom Lane authored
      In b89e1510 I had assumed it was ok to use anonymous unions as
      struct members, but while a longstanding extension in many compilers,
      it's only been standardized in C11.
      
      To fix, remove one of the anonymous unions which tried to hide some
      implementation specific enum values and give the other a name. The
      latter unfortunately requires changes in output plugins, but since the
      feature has only been added a few days ago...
      
      Andres Freund
      ea177a3b
    • Tom Lane's avatar
      Fix contrib/postgres_fdw to handle multiple join conditions properly. · 83204e10
      Tom Lane authored
      The previous coding supposed that it could consider just a single join
      condition in any one parameterized path for the foreign table.  But in
      reality, the parameterized-path machinery forces all join clauses that are
      "movable to" the foreign table to be evaluated at that node; including
      clauses that we might not consider safe to send across.  Such cases would
      result in an Assert failure in an assert-enabled build, and otherwise in
      sending an unsafe clause to the foreign server, which might result in
      errors or silently-wrong answers.  A lesser problem was that the
      cost/rowcount estimates generated for the parameterized path failed to
      account for any additional join quals that get assigned to the scan.
      
      To fix, rewrite postgresGetForeignPaths so that it correctly collects all
      the movable quals for any one outer relation when generating parameterized
      paths; we'll now generate just one path per outer relation not one per join
      qual.  Also fix bogus assumptions in postgresGetForeignPlan and
      estimate_path_cost_size that only safe-to-send join quals will be
      presented.
      
      Based on complaint from Etsuro Fujita that the path costs were being
      miscalculated, though this is significantly different from his proposed
      patch.
      83204e10
    • Bruce Momjian's avatar
      release notes: add item missed in 9.2.5 release · 4ea2e2d4
      Bruce Momjian authored
      Item is "Prevent errors in WAL replay due to references to uninitialized
      empty pages".
      
      Report and text by Andres Freund
      
      Backpatch through 9.2.
      4ea2e2d4
    • Bruce Momjian's avatar
      fix ReplicationSlotsCountDBSlots for dropping unrelated databases · 91d9de97
      Bruce Momjian authored
      YAMAMOTO Takashi
      91d9de97
    • Heikki Linnakangas's avatar
      Fix dangling smgr_owner pointer when a fake relcache entry is freed. · 55566c9a
      Heikki Linnakangas authored
      A fake relcache entry can "own" a SmgrRelation object, like a regular
      relcache entry. But when it was free'd, the owner field in SmgrRelation
      was not cleared, so it was left pointing to free'd memory.
      
      Amazingly this apparently hasn't caused crashes in practice, or we would've
      heard about it earlier. Andres found this with Valgrind.
      
      Report and fix by Andres Freund, with minor modifications by me. Backpatch
      to all supported versions.
      55566c9a
    • Heikki Linnakangas's avatar
      Avoid memcpy() with same source and destination address. · ad7b48ea
      Heikki Linnakangas authored
      The behavior of that is undefined, although unlikely to lead to problems in
      practice.
      
      Found by running regression tests with Valgrind.
      ad7b48ea
    • Heikki Linnakangas's avatar
      Fix name of syslog_ident GUC in docs. · 2b8483d6
      Heikki Linnakangas authored
      Michael Paquier
      2b8483d6
    • Tom Lane's avatar
      Avoid getting more than AccessShareLock when deparsing a query. · 7c318749
      Tom Lane authored
      In make_ruledef and get_query_def, we have long used AcquireRewriteLocks
      to ensure that the querytree we are about to deparse is up-to-date and
      the schemas of the underlying relations aren't changing.  Howwever, that
      function thinks the query is about to be executed, so it acquires locks
      that are stronger than necessary for the purpose of deparsing.  Thus for
      example, if pg_dump asks to deparse a rule that includes "INSERT INTO t",
      we'd acquire RowExclusiveLock on t.  That results in interference with
      concurrent transactions that might for example ask for ShareLock on t.
      Since pg_dump is documented as being purely read-only, this is unexpected.
      (Worse, it used to actually be read-only; this behavior dates back only
      to 8.1, cf commit ba420024.)
      
      Fix this by adding a parameter to AcquireRewriteLocks to tell it whether
      we want the "real" execution locks or only AccessShareLock.
      
      Report, diagnosis, and patch by Dean Rasheed.  Back-patch to all supported
      branches.
      7c318749
  4. 06 Mar, 2014 5 commits
    • Heikki Linnakangas's avatar
      isdigit() needs an unsigned char argument. · a0c2fa9b
      Heikki Linnakangas authored
      Per the C standard, the routine should be passed an int, with a value that's
      representable as an unsigned char or EOF. Passing a signed char is wrong,
      because a negative value is not representable as an unsigned char.
      Unfortunately no compiler warns about that.
      a0c2fa9b
    • Heikki Linnakangas's avatar
      Send keepalives from walsender even when busy sending WAL. · 94ae6ba7
      Heikki Linnakangas authored
      If walsender doesn't hear from the client for the time specified by
      wal_sender_timeout, it will conclude the connection or client is dead, and
      disconnect. When half of wal_sender_timeout has elapsed, it sends a ping
      to the client, leaving it the remainig half of wal_sender_timeout to
      respond. However, it only checked if half of wal_sender_timeout had elapsed
      when it was about to sleep, so if it was busy sending WAL to the client for
      long enough, it would not send the ping request in time. Then the client
      would not know it needs to send a reply, and the walsender will disconnect
      even though the client is still alive. Fix that.
      
      Andres Freund, reviewed by Robert Haas, and some further changes by me.
      Backpatch to 9.3. Earlier versions relied on the client to send the
      keepalives on its own, and hence didn't have this problem.
      94ae6ba7
    • Tom Lane's avatar
      Don't reject ROW_MARK_REFERENCE rowmarks for materialized views. · bf4052fa
      Tom Lane authored
      We should allow this so that matviews can be referenced in UPDATE/DELETE
      statements in READ COMMITTED isolation level.  The requirement for that
      is that a re-fetch by TID will see the same row version the query saw
      earlier, which is true of matviews, so there's no reason for the
      restriction.  Per bug #9398.
      
      Michael Paquier, after a suggestion by me
      bf4052fa
    • Bruce Momjian's avatar
      C comment update: relfilenode is only unique with a tablespace · 0024a3a3
      Bruce Momjian authored
      Report from Antonin Houska
      0024a3a3
    • Bruce Momjian's avatar
      docs: to_timestamp and to_date do minimal range checking · e2224faf
      Bruce Momjian authored
      Initial patch from Steve Crawford
      e2224faf
  5. 05 Mar, 2014 13 commits
  6. 04 Mar, 2014 6 commits