1. 13 Apr, 2012 5 commits
  2. 12 Apr, 2012 2 commits
    • Tom Lane's avatar
      Assorted spelling corrections. · 81e3e4fd
      Tom Lane authored
      Thom Brown
      81e3e4fd
    • Tom Lane's avatar
      Fix cost estimation for indexscan filter conditions. · 732bfa24
      Tom Lane authored
      cost_index's method for estimating per-tuple costs of evaluating filter
      conditions (a/k/a qpquals) was completely wrong in the presence of derived
      indexable conditions, such as range conditions derived from a LIKE clause.
      This was largely masked in common cases as a result of all simple operator
      clauses having about the same costs, but it could show up in a big way when
      dealing with functional indexes containing expensive functions, as seen for
      example in bug #6579 from Istvan Endredy.  Rejigger the calculation to give
      sane answers when the indexquals aren't a subset of the baserestrictinfo
      list.  As a side benefit, we now do the calculation properly for cases
      involving join clauses (ie, parameterized indexscans), which we always
      overestimated before.
      
      There are still cases where this is an oversimplification, such as clauses
      that can be dropped because they are implied by a partial index's
      predicate.  But we've never accounted for that in cost estimates before,
      and I'm not convinced it's worth the cycles to try to do so.
      732bfa24
  3. 11 Apr, 2012 3 commits
    • Tom Lane's avatar
      Silently ignore any nonexistent schemas that are listed in search_path. · 880bfc32
      Tom Lane authored
      Previously we attempted to throw an error or at least warning for missing
      schemas, but this was done inconsistently because of implementation
      restrictions (in many cases, GUC settings are applied outside transactions
      so that we can't do system catalog lookups).  Furthermore, there were
      exceptions to the rule even in the beginning, and we'd been poking more
      and more holes in it as time went on, because it turns out that there are
      lots of use-cases for having some irrelevant items in a common search_path
      value.  It seems better to just adopt a philosophy similar to what's always
      been done with Unix PATH settings, wherein nonexistent or unreadable
      directories are silently ignored.
      
      This commit also fixes the documentation to point out that schemas for
      which the user lacks USAGE privilege are silently ignored.  That's always
      been true but was previously not documented.
      
      This is mostly in response to Robert Haas' complaint that 9.1 started to
      throw errors or warnings for missing schemas in cases where prior releases
      had not.  We won't adopt such a significant behavioral change in a back
      branch, so something different will be needed in 9.1.
      880bfc32
    • Alvaro Herrera's avatar
      Accept postgres:// URIs in libpq connection functions · b035cb9d
      Alvaro Herrera authored
      postgres:// URIs are an attempt to "stop the bleeding" in this general
      area that has been said to occur due to external projects adopting their
      own syntaxes.  The syntaxes supported by this patch:
      
       postgres://[user[:pwd]@][unix-socket][:port[/dbname]][?param1=value1&...]
       postgres://[user[:pwd]@][net-location][:port][/dbname][?param1=value1&...]
      
      should be enough to cover most interesting cases without having to
      resort to "param=value" pairs, but those are provided for the cases that
      need them regardless.
      
      libpq documentation has been shuffled around a bit, to avoid stuffing
      all the format details into the PQconnectdbParams description, which was
      already a bit overwhelming.  The list of keywords has moved to its own
      subsection, and the details on the URI format live in another subsection.
      
      This includes a simple test program, as requested in discussion, to
      ensure that interesting corner cases continue to work appropriately in
      the future.
      
      Author: Alexander Shulgin
      Some tweaking by Álvaro Herrera, Greg Smith, Daniel Farina, Peter Eisentraut
      Reviewed by Robert Haas, Alexey Klyukin (offlist), Heikki Linnakangas,
      Marko Kreen, and others
      
      Oh, it also supports postgresql:// but that's probably just an accident.
      b035cb9d
    • Tom Lane's avatar
      Make pg_tablespace_location(0) return the database's default tablespace. · 3769fa5f
      Tom Lane authored
      This definition is convenient when applying the function to the
      reltablespace column of pg_class, since that's what zero means there;
      and it doesn't interfere with any other plausible use of the function.
      Per gripe from Bruce Momjian.
      3769fa5f
  4. 10 Apr, 2012 7 commits
  5. 09 Apr, 2012 8 commits
  6. 08 Apr, 2012 3 commits
    • Tom Lane's avatar
      Improve management of "sticky" entries in contrib/pg_stat_statements. · d5375491
      Tom Lane authored
      This patch addresses a deficiency in the previous pg_stat_statements patch.
      We want to give sticky entries an initial "usage" factor high enough that
      they probably will stick around until their query is completed.  However,
      if the query never completes (eg it gets an error during execution), the
      entry shouldn't persist indefinitely.  Manage this by starting out with
      a usage setting equal to the (approximate) median usage value within the
      whole hashtable, but decaying the value much more aggressively than we
      do for normal entries.
      
      Peter Geoghegan
      d5375491
    • Heikki Linnakangas's avatar
      set_stack_base() no longer needs to be called in PostgresMain. · 03529a3f
      Heikki Linnakangas authored
      This was a thinko in previous commit. Now that stack base pointer is now set
      in PostmasterMain and SubPostmasterMain, it doesn't need to be set in
      PostgresMain anymore.
      03529a3f
    • Heikki Linnakangas's avatar
      Do stack-depth checking in all postmaster children. · ef3883d1
      Heikki Linnakangas authored
      We used to only initialize the stack base pointer when starting up a regular
      backend, not in other processes. In particular, autovacuum workers can run
      arbitrary user code, and without stack-depth checking, infinite recursion
      in e.g an index expression will bring down the whole cluster.
      
      The comment about PL/Java using set_stack_base() is not yet true. As the
      code stands, PL/java still modifies the stack_base_ptr variable directly.
      However, it's been discussed in the PL/Java mailing list that it should be
      changed to use the function, because PL/Java is currently oblivious to the
      register stack used on Itanium. There's another issues with PL/Java, namely
      that the stack base pointer it sets is not really the base of the stack, it
      could be something close to the bottom of the stack. That's a separate issue
      that might need some further changes to this code, but that's a different
      story.
      
      Backpatch to all supported releases.
      ef3883d1
  7. 07 Apr, 2012 4 commits
  8. 06 Apr, 2012 8 commits