Skip to content
Snippets Groups Projects
  1. Feb 07, 2017
  2. Feb 06, 2017
  3. Jan 23, 2017
  4. Jan 03, 2017
  5. Dec 30, 2016
  6. Dec 27, 2016
  7. Dec 22, 2016
  8. Dec 14, 2016
  9. Dec 07, 2016
    • Tom Lane's avatar
      Handle empty or all-blank PAGER setting more sanely in psql. · 1ec5cc02
      Tom Lane authored
      If the PAGER environment variable is set but contains an empty string,
      psql would pass it to "sh" which would silently exit, causing whatever
      query output we were printing to vanish entirely.  This is quite
      mystifying; it took a long time for us to figure out that this was the
      cause of Joseph Brenner's trouble report.  Rather than allowing that
      to happen, we should treat this as another way to specify "no pager".
      (We could alternatively treat it as selecting the default pager, but
      it seems more likely that the former is what the user meant to achieve
      by setting PAGER this way.)
      
      Nonempty, but all-white-space, PAGER values have the same behavior, and
      it's pretty easy to test for that, so let's handle that case the same way.
      
      Most other cases of faulty PAGER values will result in the shell printing
      some kind of complaint to stderr, which should be enough to diagnose the
      problem, so we don't need to work harder than this.  (Note that there's
      been an intentional decision not to be very chatty about apparent failure
      returns from the pager process, since that may happen if, eg, the user
      quits the pager with control-C or some such.  I'd just as soon not start
      splitting hairs about which exit codes might merit making our own report.)
      
      libpq's old PQprint() function was already on board with ignoring empty
      PAGER values, but for consistency, make it ignore all-white-space values
      as well.
      
      It's been like this a long time, so back-patch to all supported branches.
      
      Discussion: https://postgr.es/m/CAFfgvXWLOE2novHzYjmQK8-J6TmHz42G8f3X0SORM44+stUGmw@mail.gmail.com
      1ec5cc02
  10. Nov 30, 2016
    • Tom Lane's avatar
      Doc: improve description of trim() and related functions. · 3e65fd04
      Tom Lane authored
      Per bug #14441 from Mark Pether, the documentation could be misread,
      mainly because some of the examples failed to show what happens with
      a multicharacter "characters to trim" string.  Also, while the text
      description in most of these entries was fairly clear that the
      "characters" argument is a set of characters not a substring to match,
      some of them used variant wording that was a bit less clear.
      trim() itself suffered from both deficiencies and was thus pretty
      misinterpretable.
      
      Also fix failure to explain which of LEADING/TRAILING/BOTH is the
      default.
      
      Discussion: https://postgr.es/m/20161130011710.6539.53657@wrigleys.postgresql.org
      3e65fd04
  11. Nov 29, 2016
    • Stephen Frost's avatar
      Clarify pg_dump -b documentation · f4571999
      Stephen Frost authored
      The documentation around the -b/--blobs option to pg_dump seemed to
      imply that it might be possible to add blobs to a "schema-only" dump or
      similar.  Clarify that blobs are data and therefore will only be
      included in dumps where data is being included, even when -b is used to
      request blobs be included.
      
      The -b option has been around since before 9.2, so back-patch to all
      supported branches.
      
      Discussion: https://postgr.es/m/20161119173316.GA13284@tamriel.snowman.net
      f4571999
  12. Nov 22, 2016
    • Tom Lane's avatar
      Doc: improve documentation about composite-value usage. · 13148390
      Tom Lane authored
      Create a section specifically for the syntactic rules around whole-row
      variable usage, such as expansion of "foo.*".  This was previously
      documented only haphazardly, with some critical info buried in
      unexpected places like xfunc-sql-composite-functions.  Per repeated
      questions in different mailing lists.
      
      Discussion: <16288.1479610770@sss.pgh.pa.us>
      13148390
    • Tom Lane's avatar
      Doc: add a section in Part II concerning RETURNING. · ab33ecc8
      Tom Lane authored
      There are assorted references to RETURNING in Part II, but nothing
      that would qualify as an explanation of the feature, which seems
      like an oversight considering how useful it is.  Add something.
      
      Noted while looking for a place to point a cross-reference to ...
      ab33ecc8
  13. Nov 08, 2016
  14. Nov 06, 2016
    • Tom Lane's avatar
      Rationalize and document pltcl's handling of magic ".tupno" array element. · 92b7b105
      Tom Lane authored
      For a very long time, pltcl's spi_exec and spi_execp commands have had
      a behavior of storing the current row number as an element of output
      arrays, but this was never documented.  Fix that.
      
      For an equally long time, pltcl_trigger_handler had a behavior of silently
      ignoring ".tupno" as an output column name, evidently so that the result
      of spi_exec could be used directly as a trigger result tuple.  Not sure
      how useful that really is, but in any case it's bad that it would break
      attempts to use ".tupno" as an actual column name.  We can fix it by not
      checking for ".tupno" until after we check for a column name match.  This
      comports with the effective behavior of spi_exec[p] that ".tupno" is only
      magic when you don't have an actual column named that.
      
      In passing, wordsmith the description of returning modified tuples from
      a pltcl trigger.
      
      Noted while working on Jim Nasby's patch to support composite results
      from pltcl.  The inability to return trigger tuples using ".tupno" as
      a column name is a bug, so back-patch to all supported branches.
      92b7b105
  15. Oct 24, 2016
  16. Oct 21, 2016
  17. Sep 26, 2016
    • Tom Lane's avatar
      Document has_type_privilege(). · d3af3c01
      Tom Lane authored
      Evidently an oversight in commit 72920557.  Back-patch to 9.2 where
      privileges for types were introduced.
      
      Report: <20160922173517.8214.88959@wrigleys.postgresql.org>
      d3af3c01
  18. Sep 23, 2016
    • Tom Lane's avatar
      Doc: fix examples of # operators so they actually work. · ded7c558
      Tom Lane authored
      These worked as-is until around 7.0, but fail in newer versions because
      there are more operators named "#".  Besides it's a bit inconsistent that
      only two of the examples on this page lack type names on their constants.
      
      Report: <20160923081530.1517.75670@wrigleys.postgresql.org>
      ded7c558
  19. Sep 20, 2016
  20. Sep 02, 2016
    • Tom Lane's avatar
      Don't require dynamic timezone abbreviations to match underlying time zone. · 1195b8ef
      Tom Lane authored
      Previously, we threw an error if a dynamic timezone abbreviation did not
      match any abbreviation recorded in the referenced IANA time zone entry.
      That seemed like a good consistency check at the time, but it turns out
      that a number of the abbreviations in the IANA database are things that
      Olson and crew made up out of whole cloth.  Their current policy is to
      remove such names in favor of using simple numeric offsets.  Perhaps
      unsurprisingly, a lot of these made-up abbreviations have varied in meaning
      over time, which meant that our commit b2cbced9 and later changes made
      them into dynamic abbreviations.  So with newer IANA database versions
      that don't mention these abbreviations at all, we fail, as reported in bug
      #14307 from Neil Anderson.  It's worse than just a few unused-in-the-wild
      abbreviations not working, because the pg_timezone_abbrevs view stops
      working altogether (since its underlying function tries to compute the
      whole view result in one call).
      
      We considered deleting these abbreviations from our abbreviations list, but
      the problem with that is that we can't stay ahead of possible future IANA
      changes.  Instead, let's leave the abbreviations list alone, and treat any
      "orphaned" dynamic abbreviation as just meaning the referenced time zone.
      It will behave a bit differently than it used to, in that you can't any
      longer override the zone's standard vs. daylight rule by using the "wrong"
      abbreviation of a pair, but that's better than failing entirely.  (Also,
      this solution can be interpreted as adding a small new feature, which is
      that any abbreviation a user wants can be defined as referencing a time
      zone name.)
      
      Back-patch to all supported branches, since this problem affects all
      of them when using tzdata 2016f or newer.
      
      Report: <20160902031551.15674.67337@wrigleys.postgresql.org>
      Discussion: <6189.1472820913@sss.pgh.pa.us>
      1195b8ef
  21. Aug 11, 2016
    • Tom Lane's avatar
      Doc: write some for adminpack. · 0d762ff2
      Tom Lane authored
      Previous contents of adminpack.sgml were rather far short of project norms.
      Not to mention being outright wrong about the signature of pg_file_read().
      0d762ff2
  22. Aug 09, 2016
  23. Aug 08, 2016
    • Tom Lane's avatar
      Last-minute updates for release notes. · c5081941
      Tom Lane authored
      Security: CVE-2016-5423, CVE-2016-5424
      c5081941
    • Noah Misch's avatar
      Introduce a psql "\connect -reuse-previous=on|off" option. · f744e890
      Noah Misch authored
      The decision to reuse values of parameters from a previous connection
      has been based on whether the new target is a conninfo string.  Add this
      means of overriding that default.  This feature arose as one component
      of a fix for security vulnerabilities in pg_dump, pg_dumpall, and
      pg_upgrade, so back-patch to 9.1 (all supported versions).  In 9.3 and
      later, comment paragraphs that required update had already-incorrect
      claims about behavior when no connection is open; fix those problems.
      
      Security: CVE-2016-5424
      f744e890
    • Tom Lane's avatar
      22f9b3dd
    • Tom Lane's avatar
      Fix misestimation of n_distinct for a nearly-unique column with many nulls. · 127d7300
      Tom Lane authored
      If ANALYZE found no repeated non-null entries in its sample, it set the
      column's stadistinct value to -1.0, intending to indicate that the entries
      are all distinct.  But what this value actually means is that the number
      of distinct values is 100% of the table's rowcount, and thus it was
      overestimating the number of distinct values by however many nulls there
      are.  This could lead to very poor selectivity estimates, as for example
      in a recent report from Andreas Joseph Krogh.  We should discount the
      stadistinct value by whatever we've estimated the nulls fraction to be.
      (That is what will happen if we choose to use a negative stadistinct for
      a column that does have repeated entries, so this code path was just
      inconsistent.)
      
      In addition to fixing the stadistinct entries stored by several different
      ANALYZE code paths, adjust the logic where get_variable_numdistinct()
      forces an "all distinct" estimate on the basis of finding a relevant unique
      index.  Unique indexes don't reject nulls, so there's no reason to assume
      that the null fraction doesn't apply.
      
      Back-patch to all supported branches.  Back-patching is a bit of a judgment
      call, but this problem seems to affect only a few users (else we'd have
      identified it long ago), and it's bad enough when it does happen that
      destabilizing plan choices in a worse direction seems unlikely.
      
      Patch by me, with documentation wording suggested by Dean Rasheed
      
      Report: <VisenaEmail.26.df42f82acae38a58.156463942b8@tc7-visena>
      Discussion: <16143.1470350371@sss.pgh.pa.us>
      127d7300
  24. Aug 03, 2016
  25. Aug 02, 2016
  26. Aug 01, 2016
    • Fujii Masao's avatar
      Fix pg_basebackup so that it accepts 0 as a valid compression level. · a2161775
      Fujii Masao authored
      The help message for pg_basebackup specifies that the numbers 0 through 9
      are accepted as valid values of -Z option. But, previously -Z 0 was rejected
      as an invalid compression level.
      
      Per discussion, it's better to make pg_basebackup treat 0 as valid
      compression level meaning no compression, like pg_dump.
      
      Back-patch to all supported versions.
      
      Reported-By: Jeff Janes
      Reviewed-By: Amit Kapila
      Discussion: CAMkU=1x+GwjSayc57v6w87ij6iRGFWt=hVfM0B64b1_bPVKRqg@mail.gmail.com
      a2161775
    • Tom Lane's avatar
      Doc: remove claim that hash index creation depends on effective_cache_size. · de818d4c
      Tom Lane authored
      This text was added by commit ff213239, and not long thereafter obsoleted
      by commit 4adc2f72 (which made the test depend on NBuffers instead); but
      nobody noticed the need for an update.  Commit 9563d5b5 adds some further
      dependency on maintenance_work_mem, but the existing verbiage seems to
      cover that with about as much precision as we really want here.  Let's
      just take it all out rather than leaving ourselves open to more errors of
      omission in future.  (That solution makes this change back-patchable, too.)
      
      Noted by Peter Geoghegan.
      
      Discussion: <CAM3SWZRVANbj9GA9j40fAwheQCZQtSwqTN1GBTVwRrRbmSf7cg@mail.gmail.com>
      de818d4c
  27. Jul 30, 2016
  28. Jul 28, 2016
    • Tom Lane's avatar
      Improve documentation about CREATE TABLE ... LIKE. · a9a99818
      Tom Lane authored
      The docs failed to explain that LIKE INCLUDING INDEXES would not preserve
      the names of indexes and associated constraints.  Also, it wasn't mentioned
      that EXCLUDE constraints would be copied by this option.  The latter
      oversight seems enough of a documentation bug to justify back-patching.
      
      In passing, do some minor copy-editing in the same area, and add an entry
      for LIKE under "Compatibility", since it's not exactly a faithful
      implementation of the standard's feature.
      
      Discussion: <20160728151154.AABE64016B@smtp.hushmail.com>
      a9a99818
    • Fujii Masao's avatar
      Fix incorrect description of udt_privileges view in documentation. · 5e50a671
      Fujii Masao authored
      The description of udt_privileges view contained an incorrect copy-pasted word.
      
      Back-patch to 9.2 where udt_privileges view was added.
      
      Author: Alexander Law
      5e50a671
  29. Jul 26, 2016
    • Tom Lane's avatar
      Fix constant-folding of ROW(...) IS [NOT] NULL with composite fields. · bcdd8a19
      Tom Lane authored
      The SQL standard appears to specify that IS [NOT] NULL's tests of field
      nullness are non-recursive, ie, we shouldn't consider that a composite
      field with value ROW(NULL,NULL) is null for this purpose.
      ExecEvalNullTest got this right, but eval_const_expressions did not,
      leading to weird inconsistencies depending on whether the expression
      was such that the planner could apply constant folding.
      
      Also, adjust the docs to mention that IS [NOT] DISTINCT FROM NULL can be
      used as a substitute test if a simple null check is wanted for a rowtype
      argument.  That motivated reordering things so that IS [NOT] DISTINCT FROM
      is described before IS [NOT] NULL.  In HEAD, I went a bit further and added
      a table showing all the comparison-related predicates.
      
      Per bug #14235.  Back-patch to all supported branches, since it's certainly
      undesirable that constant-folding should change the semantics.
      
      Report and patch by Andrew Gierth; assorted wordsmithing and revised
      regression test cases by me.
      
      Report: <20160708024746.1410.57282@wrigleys.postgresql.org>
      bcdd8a19
  30. Jul 15, 2016
  31. Jul 11, 2016
  32. Jul 02, 2016
    • Bruce Momjian's avatar
      doc: mention dependency on collation libraries · cfb33bc3
      Bruce Momjian authored
      Document that index storage is dependent on the operating system's
      collation library ordering, and any change in that ordering can create
      invalid indexes.
      
      Discussion: 20160617154311.GB19359@momjian.us
      
      Backpatch-through: 9.1
      cfb33bc3
Loading