1. 30 Aug, 2012 4 commits
    • Robert Haas's avatar
    • Peter Eisentraut's avatar
      Also check for Python platform-specific include directory · 9cffb187
      Peter Eisentraut authored
      Python can be built to have two separate include directories: one for
      platform-independent files and one for platform-specific files.  So
      far, this has apparently never mattered for a PL/Python build.  But
      with the new multi-arch Python packages in Debian and Ubuntu, this is
      becoming the standard configuration on these platforms, so we must
      check these directories separately to be able to build there.
      
      Also add a bit of reporting in configure to be able to see better what
      is going on with this.
      9cffb187
    • Tom Lane's avatar
      Adjust definition of cheapest_total_path to work better with LATERAL. · e83bb10d
      Tom Lane authored
      In the initial cut at LATERAL, I kept the rule that cheapest_total_path
      was always unparameterized, which meant it had to be NULL if the relation
      has no unparameterized paths.  It turns out to work much more nicely if
      we always have *some* path nominated as cheapest-total for each relation.
      In particular, let's still say it's the cheapest unparameterized path if
      there is one; if not, take the cheapest-total-cost path among those of
      the minimum available parameterization.  (The first rule is actually
      a special case of the second.)
      
      This allows reversion of some temporary lobotomizations I'd put in place.
      In particular, the planner can now consider hash and merge joins for
      joins below a parameter-supplying nestloop, even if there aren't any
      unparameterized paths available.  This should bring planning of
      LATERAL-containing queries to the same level as queries not using that
      feature.
      
      Along the way, simplify management of parameterized paths in add_path()
      and friends.  In the original coding for parameterized paths in 9.2,
      I tried to minimize the logic changes in add_path(), so it just treated
      parameterization as yet another dimension of comparison for paths.
      We later made it ignore pathkeys (sort ordering) of parameterized paths,
      on the grounds that ordering isn't a useful property for the path on the
      inside of a nestloop, so we might as well get rid of useless parameterized
      paths as quickly as possible.  But we didn't take that reasoning as far as
      we should have.  Startup cost isn't a useful property inside a nestloop
      either, so add_path() ought to discount startup cost of parameterized paths
      as well.  Having done that, the secondary sorting I'd implemented (in
      add_parameterized_path) is no longer needed --- any parameterized path that
      survives add_path() at all is worth considering at higher levels.  So this
      should be a bit faster as well as simpler.
      e83bb10d
    • Bruce Momjian's avatar
      9fe6da5c
  2. 29 Aug, 2012 4 commits
  3. 28 Aug, 2012 14 commits
  4. 27 Aug, 2012 10 commits
    • Bruce Momjian's avatar
      483c2c10
    • Alvaro Herrera's avatar
      pg_upgrade: Fix exec_prog API to be less flaky · 088c065c
      Alvaro Herrera authored
      The previous signature made it very easy to pass something other than
      the printf-format specifier in the corresponding position, without any
      warning from the compiler.
      
      While at it, move some of the escaping, redirecting and quoting
      responsibilities from the callers into exec_prog() itself.  This makes
      the callsites cleaner.
      088c065c
    • Alvaro Herrera's avatar
      Fix thinko in comment · 34c02044
      Alvaro Herrera authored
      It was confusing symlinks with hard links.
      34c02044
    • Alvaro Herrera's avatar
      ab577e63
    • Tom Lane's avatar
      Fix DROP INDEX CONCURRENTLY IF EXISTS. · e323c553
      Tom Lane authored
      This threw ERROR, not the expected NOTICE, if the index didn't exist.
      The bug was actually visible in not-as-expected regression test output,
      so somebody wasn't paying too close attention in commit
      8cb53654.
      Per report from Brendan Byrd.
      e323c553
    • Bruce Momjian's avatar
      Have pgindent requre pg_bsd_indent version 1.2 now that a new version · e40bddb0
      Bruce Momjian authored
      has been created by adding #include <stdlib.h> to parse.c.
      
      per request from Kevin Grittner.
      e40bddb0
    • Heikki Linnakangas's avatar
      Collect and use histograms of lower and upper bounds for range types. · 918eee0c
      Heikki Linnakangas authored
      This enables selectivity estimation of the <<, >>, &<, &> and && operators,
      as well as the normal inequality operators: <, <=, >=, >. "range @> element"
      is also supported, but the range-variant @> and <@ operators are not,
      because they cannot be sensibly estimated with lower and upper bound
      histograms alone. We would need to make some assumption about the lengths of
      the ranges for that. Alexander's patch included a separate histogram of
      lengths for that, but I left that out of the patch for simplicity. Hopefully
      that will be added as a followup patch.
      
      The fraction of empty ranges is also calculated and used in estimation.
      
      Alexander Korotkov, heavily modified by me.
      918eee0c
    • Peter Eisentraut's avatar
      pg_basebackup: Correct error message · 6bb0b08f
      Peter Eisentraut authored
      It still thought that the --xlog-method option argument could be
      empty, as in a previous version of this feature.
      6bb0b08f
    • Bruce Momjian's avatar
      Update FreeBSD kernel configuration documentation. · 7a42dff4
      Bruce Momjian authored
      Brad Davis
      7a42dff4
    • Tom Lane's avatar
      Fix up planner infrastructure to support LATERAL properly. · 9ff79b9d
      Tom Lane authored
      This patch takes care of a number of problems having to do with failure
      to choose valid join orders and incorrect handling of lateral references
      pulled up from subqueries.  Notable changes:
      
      * Add a LateralJoinInfo data structure similar to SpecialJoinInfo, to
      represent join ordering constraints created by lateral references.
      (I first considered extending the SpecialJoinInfo structure, but the
      semantics are different enough that a separate data structure seems
      better.)  Extend join_is_legal() and related functions to prevent trying
      to form unworkable joins, and to ensure that we will consider joins that
      satisfy lateral references even if the joins would be clauseless.
      
      * Fill in the infrastructure needed for the last few types of relation scan
      paths to support parameterization.  We'd have wanted this eventually
      anyway, but it is necessary now because a relation that gets pulled up out
      of a UNION ALL subquery may acquire a reltargetlist containing lateral
      references, meaning that its paths *have* to be parameterized whether or
      not we have any code that can push join quals down into the scan.
      
      * Compute data about lateral references early in query_planner(), and save
      in RelOptInfo nodes, to avoid repetitive calculations later.
      
      * Assorted corner-case bug fixes.
      
      There's probably still some bugs left, but this is a lot closer to being
      real than it was before.
      9ff79b9d
  5. 26 Aug, 2012 2 commits
  6. 25 Aug, 2012 4 commits
  7. 24 Aug, 2012 2 commits
    • Tom Lane's avatar
      Fix issues with checks for unsupported transaction states in Hot Standby. · 7abaa6b9
      Tom Lane authored
      The GUC check hooks for transaction_read_only and transaction_isolation
      tried to check RecoveryInProgress(), so as to disallow setting read/write
      mode or serializable isolation level (respectively) in hot standby
      sessions.  However, GUC check hooks can be called in many situations where
      we're not connected to shared memory at all, resulting in a crash in
      RecoveryInProgress().  Among other cases, this results in EXEC_BACKEND
      builds crashing during child process start if default_transaction_isolation
      is serializable, as reported by Heikki Linnakangas.  Protect those calls
      by silently allowing any setting when not inside a transaction; which is
      okay anyway since these GUCs are always reset at start of transaction.
      
      Also, add a check to GetSerializableTransactionSnapshot() to complain
      if we are in hot standby.  We need that check despite the one in
      check_XactIsoLevel() because default_transaction_isolation could be
      serializable.  We don't want to complain any sooner than this in such
      cases, since that would prevent running transactions at all in such a
      state; but a transaction can be run, if SET TRANSACTION ISOLATION is done
      before setting a snapshot.  Per report some months ago from Robert Haas.
      
      Back-patch to 9.1, since these problems were introduced by the SSI patch.
      
      Kevin Grittner and Tom Lane, with ideas from Heikki Linnakangas
      7abaa6b9
    • Peter Eisentraut's avatar