1. 21 7月, 2014 1 次提交
    • T
      First-draft release notes for 9.3.5. · ddc41fd2
      Tom Lane 提交于
      As usual, the release notes for older branches will be made by cutting
      these down, but put them up for community review first.
      
      Note: a few of these items actually don't apply to 9.3, but only to older
      branches.  I'll sort that out when copying the text into the older
      release-X.Y.sgml files.
      ddc41fd2
  2. 20 7月, 2014 3 次提交
    • T
      Fix xreflabel for hot_standby_feedback. · 4cbe3abb
      Tom Lane 提交于
      Rather remarkable that this has been wrong since 9.1 and nobody noticed.
      4cbe3abb
    • T
      Update time zone data files to tzdata release 2014e. · b1864fab
      Tom Lane 提交于
      DST law changes in Crimea, Egypt, Morocco.  New zone Antarctica/Troll
      for Norwegian base in Queen Maud Land.
      b1864fab
    • T
      Partial fix for dropped columns in functions returning composite. · 9b35ddce
      Tom Lane 提交于
      When a view has a function-returning-composite in FROM, and there are
      some dropped columns in the underlying composite type, ruleutils.c
      printed junk in the column alias list for the reconstructed FROM entry.
      Before 9.3, this was prevented by doing get_rte_attribute_is_dropped
      tests while printing the column alias list; but that solution is not
      currently available to us for reasons I'll explain below.  Instead,
      check for empty-string entries in the alias list, which can only exist
      if that column position had been dropped at the time the view was made.
      (The parser fills in empty strings to preserve the invariant that the
      aliases correspond to physical column positions.)
      
      While this is sufficient to handle the case of columns dropped before
      the view was made, we have still got issues with columns dropped after
      the view was made.  In particular, the view could contain Vars that
      explicitly reference such columns!  The dependency machinery really
      ought to refuse the column drop attempt in such cases, as it would do
      when trying to drop a table column that's explicitly referenced in
      views.  However, we currently neglect to store dependencies on columns
      of composite types, and fixing that is likely to be too big to be
      back-patchable (not to mention that existing views in existing databases
      would not have the needed pg_depend entries anyway).  So I'll leave that
      for a separate patch.
      
      Pre-9.3, ruleutils would print such Vars normally (with their original
      column names) even though it suppressed their entries in the RTE's
      column alias list.  This is certainly bogus, since the printed view
      definition would fail to reload, but at least it didn't crash.  However,
      as of 9.3 the printed column alias list is tightly tied to the names
      printed for Vars; so we can't treat columns as dropped for one purpose
      and not dropped for the other.  This is why we can't just put back the
      get_rte_attribute_is_dropped test: it results in an assertion failure
      if the view in fact contains any Vars referencing the dropped column.
      Once we've got dependencies preventing such cases, we'll probably want
      to do it that way instead of relying on the empty-string test used here.
      
      This fix turned up a very ancient bug in outfuncs/readfuncs, namely
      that T_String nodes containing empty strings were not dumped/reloaded
      correctly: the node was printed as "<>" which is read as a string
      value of <>.  Since (per SQL) we disallow empty-string identifiers,
      such nodes don't occur normally, which is why we'd not noticed.
      (Such nodes aren't used for literal constants, just identifiers.)
      
      Per report from Marc Schablewski.  Back-patch to 9.3 which is where
      the rule printing behavior changed.  The dangling-variable case is
      broken all the way back, but that's not what his complaint is about.
      9b35ddce
  3. 19 7月, 2014 2 次提交
    • N
      Limit pg_upgrade authentication advice to always-secure techniques. · 85f95739
      Noah Misch 提交于
      ~/.pgpass is a sound choice everywhere, and "peer" authentication is
      safe on every platform it supports.  Cease to recommend "trust"
      authentication, the safety of which is deeply configuration-specific.
      Back-patch to 9.0, where pg_upgrade was introduced.
      85f95739
    • T
      Fix two low-probability memory leaks in regular expression parsing. · 1567e659
      Tom Lane 提交于
      If pg_regcomp failed after having invoked markst/cleanst, it would leak any
      "struct subre" nodes it had created.  (We've already detected all regex
      syntax errors at that point, so the only likely causes of later failure
      would be query cancel or out-of-memory.)  To fix, make sure freesrnode
      knows the difference between the pre-cleanst and post-cleanst cleanup
      procedures.  Add some documentation of this less-than-obvious point.
      
      Also, newlacon did the wrong thing with an out-of-memory failure from
      realloc(), so that the previously allocated array would be leaked.
      
      Both of these are pretty low-probability scenarios, but a bug is a bug,
      so patch all the way back.
      
      Per bug #10976 from Arthur O'Dwyer.
      1567e659
  4. 17 7月, 2014 3 次提交
    • M
      Revert broken change to pgevent.c · 6cd471a6
      Magnus Hagander 提交于
      pgevent doesn't include the global PostgreSQL headers, for a reason,
      and therefor cannot rely on defines in it...
      6cd471a6
    • M
      Add option to pg_ctl to choose event source for logging · c0e4520b
      Magnus Hagander 提交于
      pg_ctl will log to the Windows event log when it is running as a service,
      which is the primary way of running PostgreSQL on Windows. This option
      makes it possible to specify which event source to use for this, in order
      to separate different instances. The server logging itself is still controlled
      by the regular logging parameters, including a separate setting for the event
      source. The parameter to pg_ctl only controlls the logging from pg_ctl itself.
      
      MauMau, review in many iterations by Amit Kapila and me.
      c0e4520b
    • P
      doc: Spell checking · aa688725
      Peter Eisentraut 提交于
      aa688725
  5. 16 7月, 2014 10 次提交
    • H
      Fix bugs in SP-GiST search with range type's -|- (adjacent) operator. · 1264ef31
      Heikki Linnakangas 提交于
      The consistent function contained several bugs:
      
      * The "if (which2) { ... }"  block was broken. It compared the  argument's
      lower bound against centroid's upper bound, while it was supposed to compare
      the argument's upper bound against the centroid's lower bound (the comment
      was correct, code was wrong). Also, it cleared bits in the "which1"
      variable, while it was supposed to clear bits in "which2".
      
      * If the argument's upper bound was equal to the centroid's lower bound, we
      descended to both halves (= all quadrants). That's unnecessary, searching
      the right quadrants is sufficient. This didn't lead to incorrect query
      results, but was clearly wrong, and slowed down queries unnecessarily.
      
      * In the case that argument's lower bound is adjacent to the centroid's
      upper bound, we also don't need to visit all quadrants. Per similar
      reasoning as previous point.
      
      * The code where we compare the previous centroid with the current centroid
      should match the code where we compare the current centroid with the
      argument. The point of that code is to redo the calculation done in the
      previous level, to see if we were supposed to traverse left or right (or up
      or down), and if we actually did. If we moved in the different direction,
      then we know there are no matches for bound.
      
      Refactor the code and adds comments to make it more readable and easier to
      reason about.
      
      Backpatch to 9.3 where SP-GiST support for range types was introduced.
      1264ef31
    • T
      Allow join removal in some cases involving a left join to a subquery. · f15821ee
      Tom Lane 提交于
      We can remove a left join to a relation if the relation's output is
      provably distinct for the columns involved in the join clause (considering
      only equijoin clauses) and the relation supplies no variables needed above
      the join.  Previously, the join removal logic could only prove distinctness
      by reference to unique indexes of a table.  This patch extends the logic
      to consider subquery relations, wherein distinctness might be proven by
      reference to GROUP BY, DISTINCT, etc.
      
      We actually already had some code to check that a subquery's output was
      provably distinct, but it was hidden inside pathnode.c; which was a pretty
      bad place for it really, since that file is mostly boilerplate Path
      construction and comparison.  Move that code to analyzejoins.c, which is
      arguably a more appropriate location, and is certainly the site of the
      new usage for it.
      
      David Rowley, reviewed by Simon Riggs
      f15821ee
    • M
      Move check for SSL_get_current_compression to run on mingw · 5571caf4
      Magnus Hagander 提交于
      Mingw uses a different header file than msvc, so we don't get the
      hardcoded value, so we need the configure test to run.
      5571caf4
    • P
      9a218c02
    • P
      pg_upgrade: Fix spacing in help output · e0da6ec6
      Peter Eisentraut 提交于
      e0da6ec6
    • P
      pg_basebackup: Add more information about --max-rate option to help output · e806da6b
      Peter Eisentraut 提交于
      It was previously not clear what unit the option argument should have.
      e806da6b
    • A
      json_build_object and json_build_array are stable, not immutable. · 0f43a553
      Andrew Dunstan 提交于
      These functions indirectly invoke output functions, so they can't be
      immutable.
      
      Backpatch to 9.4 where they were introduced.
      
      Catalog version bumped.
      0f43a553
    • A
      Add missing doc changes for ee80f043 · da6ac4a6
      Alvaro Herrera 提交于
      Per note from Tom Lane
      da6ac4a6
    • A
      Fix REASSIGN OWNED for text search objects · 6bdf4b9c
      Alvaro Herrera 提交于
      Trying to reassign objects owned by a user that had text search
      dictionaries or configurations used to fail with:
      ERROR:  unexpected classid 3600
      or
      ERROR:  unexpected classid 3602
      
      Fix by adding cases for those object types in a switch in pg_shdepend.c.
      
      Both REASSIGN OWNED and text search objects go back all the way to 8.1,
      so backpatch to all supported branches.  In 9.3 the alter-owner code was
      made generic, so the required change in recent branches is pretty
      simple; however, for 9.2 and older ones we need some additional
      reshuffling to enable specifying objects by OID rather than name.
      
      Text search templates and parsers are not owned objects, so there's no
      change required for them.
      
      Per bug #9749 reported by Michal Novotný
      6bdf4b9c
    • M
      Detect presence of SSL_get_current_compression · c9e1ad7f
      Magnus Hagander 提交于
      Apparently we still build against OpenSSL so old that it doesn't
      have this function, so add an autoconf check for it to make the
      buildfarm happy. If the function doesn't exist, always return
      that compression is disabled, since presumably the actual
      compression functionality is always missing.
      
      For now, hardcode the function as present on MSVC, since we should
      hopefully be well beyond those old versions on that platform.
      c9e1ad7f
  6. 15 7月, 2014 14 次提交
  7. 14 7月, 2014 2 次提交
  8. 13 7月, 2014 1 次提交
  9. 12 7月, 2014 4 次提交
    • A
      Minimal psql tab completion support for SET search_path. · bd409519
      Andres Freund 提交于
      Complete SET search_path = ... to non-temporary and non-toast
      schemas. Since there pretty much is no use case to add those to the
      search path and there can be many it's helpful to exclude them.
      
      It'd be nicer to complete multiple search path elements, but that's
      not easy.
      
      Jeff Janes
      bd409519
    • A
      Fix decoding of consecutive MULTI_INSERTs emitted by one heap_multi_insert(). · 626bfad6
      Andres Freund 提交于
      Commit 1b86c81d fixed the decoding of toasted columns for the rows
      contained in one xl_heap_multi_insert record. But that's not actually
      enough, because heap_multi_insert() will actually first toast all
      passed in rows and then emit several *_multi_insert records; one for
      each page it fills with tuples.
      
      Add a XLOG_HEAP_LAST_MULTI_INSERT flag which is set in
      xl_heap_multi_insert->flag denoting that this multi_insert record is
      the last emitted by one heap_multi_insert() call. Then use that flag
      in decode.c to only set clear_toast_afterwards in the right situation.
      
      Expand the number of rows inserted via COPY in the corresponding
      regression test to make sure that more than one heap page is filled
      with tuples by one heap_multi_insert() call.
      
      Backpatch to 9.4 like the previous commit.
      626bfad6
    • M
      Add autocompletion of locale keywords for CREATE DATABASE · deee42ab
      Magnus Hagander 提交于
      Adds support for autocomplete of LC_COLLATE and LC_CTYPE to
      the CREATE DATABASE command in psql.
      deee42ab
    • T
      Fix bug with whole-row references to append subplans. · d6858148
      Tom Lane 提交于
      ExecEvalWholeRowVar incorrectly supposed that it could "bless" the source
      TupleTableSlot just once per query.  But if the input is coming from an
      Append (or, perhaps, other cases?) more than one slot might be returned
      over the query run.  This led to "record type has not been registered"
      errors when a composite datum was extracted from a non-blessed slot.
      
      This bug has been there a long time; I guess it escaped notice because when
      dealing with subqueries the planner tends to expand whole-row Vars into
      RowExprs, which don't have the same problem.  It is possible to trigger
      the problem in all active branches, though, as illustrated by the added
      regression test.
      d6858148