1. 10 Jul, 2019 6 commits
  2. 09 Jul, 2019 5 commits
  3. 08 Jul, 2019 5 commits
  4. 07 Jul, 2019 2 commits
  5. 06 Jul, 2019 5 commits
  6. 05 Jul, 2019 8 commits
  7. 04 Jul, 2019 9 commits
    • Tomas Vondra's avatar
      Simplify pg_mcv_list (de)serialization · 08aa131c
      Tomas Vondra authored
      The serialization format of multivariate MCV lists included alignment in
      order to allow direct access to part of the serialized data, but despite
      multiple fixes (see for example commits d85e0f36 and ea4e1c0e) this
      proved to be problematic.
      
      This commit abandons alignment in the serialized format, and just copies
      everything during deserialization.  We now also track amount of memory
      needed after deserialization (including alignment), which allows us to
      deserialize the MCV list in a single pass.
      
      Bump catversion, as this affects contents of pg_statistic_ext_data.
      
      Backpatch to 12, where multi-column MCV lists were introduced.
      
      Author: Tomas Vondra
      Reviewed-by: Tom Lane
      Discussion: https://postgr.es/m/2201.1561521148@sss.pgh.pa.us
      08aa131c
    • Tomas Vondra's avatar
      Fix pg_mcv_list_items() to produce text[] · 4d66285a
      Tomas Vondra authored
      The function pg_mcv_list_items() returns values stored in MCV items. The
      items may contain columns with different data types, so the function was
      generating text array-like representation, but in an ad-hoc way without
      properly escaping various characters etc.
      
      Fixed by simply building a text[] array, which also makes it easier to
      use from queries etc.
      
      Requires changes to pg_proc entry, so bump catversion.
      
      Backpatch to 12, where multi-column MCV lists were introduced.
      
      Author: Tomas Vondra
      Reviewed-by: Dean Rasheed
      Discussion: https://postgr.es/m/20190618205920.qtlzcu73whfpfqne@development
      4d66285a
    • Tomas Vondra's avatar
      Speed-up build of MCV lists with many distinct values · e365a581
      Tomas Vondra authored
      When building multi-column MCV lists, we compute base frequency for each
      item, i.e. a product of per-column frequencies for values from the item.
      As a value may be in multiple groups, the code was scanning the whole
      array of groups while adding items to the MCV list.  This works fine as
      long as the number of distinct groups is small, but it's easy to trigger
      trigger O(N^2) behavior, especially after increasing statistics target.
      
      This commit precomputes frequencies for values in all columns, so that
      when computing the base frequency it's enough to make a simple bsearch
      lookup in the array.
      
      Backpatch to 12, where multi-column MCV lists were introduced.
      
      Discussion: https://postgr.es/m/20190618205920.qtlzcu73whfpfqne@development
      e365a581
    • Peter Eisentraut's avatar
      Remove unnecessary casts from size_t to int · d5ab9df7
      Peter Eisentraut authored
      We can use the %zu format specifier directly, no need to cast to int.
      d5ab9df7
    • Peter Eisentraut's avatar
      Unwind some workarounds for lack of portable int64 format specifier · 6a1cd8b9
      Peter Eisentraut authored
      Because there is no portable int64/uint64 format specifier and we
      can't stick macros like INT64_FORMAT into the middle of a translatable
      string, we have been using various workarounds that put the number to
      be printed into a string buffer first.  Now that we always use our own
      sprintf(), we can rely on %lld and %llu to work, so we can use those.
      
      This patch undoes this workaround in a few places where it was
      egregiously verbose.
      Reviewed-by: default avatarTom Lane <tgl@sss.pgh.pa.us>
      Discussion: https://www.postgresql.org/message-id/flat/CAH2-Wz%3DWbNxc5ob5NJ9yqo2RMJ0q4HXDS30GVCobeCvC9A1L9A%40mail.gmail.com
      6a1cd8b9
    • Peter Eisentraut's avatar
      Sync our Snowball stemmer dictionaries with current upstream · 7b925e12
      Peter Eisentraut authored
      The main change is a new stemmer for Greek.  There are minor changes
      in the Danish and French stemmers.
      
      Author: Panagiotis Mavrogiorgos <pmav99@gmail.com>
      7b925e12
    • Peter Eisentraut's avatar
      Clean up whitespace a bit · dedb6e01
      Peter Eisentraut authored
      dedb6e01
    • Michael Paquier's avatar
      Introduce safer encoding and decoding routines for base64.c · cfc40d38
      Michael Paquier authored
      This is a follow-up refactoring after 09ec55b9 and b6742117, which has
      proved that the encoding and decoding routines used by SCRAM have a
      poor interface when it comes to check after buffer overflows.  This adds
      an extra argument in the shape of the length of the result buffer for
      each routine, which is used for overflow checks when encoding or
      decoding an input string.  The original idea comes from Tom Lane.
      
      As a result of that, the encoding routine can now fail, so all its
      callers are adjusted to generate proper error messages in case of
      problems.
      
      On failure, the result buffer gets zeroed.
      
      Author: Michael Paquier
      Reviewed-by: Daniel Gustafsson
      Discussion: https://postgr.es/m/20190623132535.GB1628@paquier.xyz
      cfc40d38
    • Michael Paquier's avatar
      Simplify TAP tests of pg_dump for connection strings · d5ab9a89
      Michael Paquier authored
      The last set of scenarios did an initialization of nodes followed by an
      extra command to set up the authentication policy with pg_regress
      --config-auth.  This configuration step can be integrated directly using
      the option auth_extra from PostgresNode::init when initializing the
      node, saving from one extra command.  On Windows, this also restricts
      more pg_ident.conf for the SSPI user mapping by removing the entry of
      the OS user running the test, which is not needed anyway.
      
      Note that IPC::Run mishandles double quotes, hence the restore user name
      is changed to map with that.  This was already done in the test as a
      later step, but not in a consistent way, causing the switch to use
      auth_extra to fail.
      
      Found while reviewing ca129e58.
      
      Discussion: https://postgr.es/m/20190703062024.GD3084@paquier.xyz
      d5ab9a89