1. 30 Sep, 2019 5 commits
  2. 29 Sep, 2019 6 commits
    • Andres Freund's avatar
      jit: Re-allow JIT compilation of execGrouping.c hashtable comparisons. · ac88807f
      Andres Freund authored
      In the course of 5567d12c, 356687bd and 317ffdfe, I changed
      BuildTupleHashTable[Ext]'s call to ExecBuildGroupingEqual to not pass
      in the parent node, but NULL. Which in turn prevents the tuple
      equality comparator from being JIT compiled.  While that fixes
      bug #15486, it is not actually necessary after all of the above commits,
      as we don't re-build the comparator when using the new
      BuildTupleHashTableExt() interface (as the content of the hashtable
      are reset, but the TupleHashTable itself is not).
      
      Therefore re-allow jit compilation for callers that use
      BuildTupleHashTableExt with a separate context for "metadata" and
      content.
      
      As in the previous commit, there's ongoing work to make this easier to
      test to prevent such regressions in the future, but that
      infrastructure is not going to be backpatchable.
      
      The performance impact of not JIT compiling hashtable equality
      comparators can be substantial e.g. for aggregation queries that
      aggregate a lot of input rows to few output rows (when there are a lot
      of output groups, there will be fewer comparisons).
      
      Author: Andres Freund
      Discussion: https://postgr.es/m/20190927072053.njf6prdl3vb7y7qb@alap3.anarazel.de
      Backpatch: 11, just as 5567d12c
      ac88807f
    • Andres Freund's avatar
      Fix determination when slot types for upper executor nodes are fixed. · 97e971ee
      Andres Freund authored
      For many queries the fact that the tuple descriptor from the lower
      node was not taken into account when determining whether the type of a
      slot is fixed, lead to tuple deforming for such upper nodes not to be
      JIT accelerated.
      
      I broke this in 675af5c0.
      
      There is ongoing work to enable writing regression tests for related
      behavior (including a patch that would have detected this
      regression), by optionally showing such details in EXPLAIN. But as it
      seems unlikely that that will be suitable for stable branches, just
      merge the fix for now.
      
      While it's fairly close to the 12 release window, the fact that 11
      continues to perform JITed tuple deforming in these cases, that
      there's still cases where we do so in 12, and the fact that the
      performance regression can be sizable, weigh in favor of fixing it
      now.
      
      Author: Andres Freund
      Discussion: https://postgr.es/m/20190927072053.njf6prdl3vb7y7qb@alap3.anarazel.de
      Backpatch: 12-, where 675af5c0 was merged.
      97e971ee
    • Andrew Dunstan's avatar
      Allow SSL TAP tests to run on Windows · 258bf86a
      Andrew Dunstan authored
      Windows does not enforce key file permissions checks in libpq, and psql
      can produce CRLF line endings on Windows.
      
      Backpatch to Release 12 (CRLF) and Release 11 (permissions check)
      258bf86a
    • Peter Eisentraut's avatar
      doc: Further clarify how recovery target parameters are applied · e04a53a6
      Peter Eisentraut authored
      Recovery target parameters are all applied even in standby mode.  The
      previous documentation mostly wished they were not but this was never
      the case.
      
      Discussion: https://www.postgresql.org/message-id/flat/e445616d-023e-a268-8aa1-67b8b335340c%40pgmasters.net
      e04a53a6
    • Tom Lane's avatar
      Fix bogus order of error checks in new channel_binding code. · 2c97f734
      Tom Lane authored
      Coverity pointed out that it's pretty silly to check for a null pointer
      after we've already dereferenced the pointer.  To fix, just swap the
      order of the two error checks.  Oversight in commit d6e612f8.
      2c97f734
    • Peter Eisentraut's avatar
      doc: Add a link target · 92f1545d
      Peter Eisentraut authored
      Forward-patched from PostgreSQL 12 release notes patch, for
      consistency.
      92f1545d
  3. 28 Sep, 2019 3 commits
  4. 27 Sep, 2019 11 commits
  5. 26 Sep, 2019 6 commits
  6. 25 Sep, 2019 9 commits
    • Alexander Korotkov's avatar
    • Tom Lane's avatar
      Fix handling of GENERATED columns in CREATE TABLE LIKE INCLUDING DEFAULTS. · b81a9c2f
      Tom Lane authored
      LIKE INCLUDING DEFAULTS tried to copy the attrdef expression without
      copying the state of the attgenerated column.  This is in fact wrong,
      because GENERATED and DEFAULT expressions are not the same kind of animal;
      one can contain Vars and the other not.  We *must* copy attgenerated
      when we're copying the attrdef expression.  Rearrange the if-tests
      so that the expression is copied only when the correct one of
      INCLUDING DEFAULTS and INCLUDING GENERATED has been specified.
      
      Per private report from Manuel Rigger.
      
      Tom Lane and Peter Eisentraut
      b81a9c2f
    • Alexander Korotkov's avatar
      Implement jsonpath .datetime() method · bffe1bd6
      Alexander Korotkov authored
      This commit implements jsonpath .datetime() method as it's specified in
      SQL/JSON standard.  There are no-argument and single-argument versions of
      this method.  No-argument version selects first of ISO datetime formats
      matching input string.  Single-argument version accepts template string as
      its argument.
      
      Additionally to .datetime() method itself this commit also implements
      comparison ability of resulting date and time values.  There is some difficulty
      because exising jsonb_path_*() functions are immutable, while comparison of
      timezoned and non-timezoned types involves current timezone.  At first, current
      timezone could be changes in session.  Moreover, timezones themselves are not
      immutable and could be updated.  This is why we let existing immutable functions
      throw errors on such non-immutable comparison.  In the same time this commit
      provides jsonb_path_*_tz() functions which are stable and support operations
      involving timezones.  As new functions are added to the system catalog,
      catversion is bumped.
      
      Support of .datetime() method was the only blocker prevents T832 from being
      marked as supported.  sql_features.txt is updated correspondingly.
      
      Extracted from original patch by Nikita Glukhov, Teodor Sigaev, Oleg Bartunov.
      Heavily revised by me.  Comments were adjusted by Liudmila Mantrova.
      
      Discussion: https://postgr.es/m/fcc6fc6a-b497-f39a-923d-aa34d0c588e8%402ndQuadrant.com
      Discussion: https://postgr.es/m/CAPpHfdsZgYEra_PeCLGNoXOWYx6iU-S3wF8aX0ObQUcZU%2B4XTw%40mail.gmail.com
      Author: Alexander Korotkov, Nikita Glukhov, Teodor Sigaev, Oleg Bartunov, Liudmila Mantrova
      Reviewed-by: Anastasia Lubennikova, Peter Eisentraut
      bffe1bd6
    • Alexander Korotkov's avatar
      Allow datetime values in JsonbValue · 6dda292d
      Alexander Korotkov authored
      SQL/JSON standard allows manipulation with datetime values.  So, it appears to
      be convinient to allow datetime values to be represented in JsonbValue struct.
      These datetime values are allowed for temporary representation only.  During
      serialization datetime values are converted into strings.
      
      SQL/JSON requires writing timestamps with timezone in the same timezone offset
      as they were parsed.  This is why we allow storage of timezone offset in
      JsonbValue struct.  For the same reason timezone offset argument is added to
      JsonEncodeDateTime() function.
      
      Extracted from original patch by Nikita Glukhov, Teodor Sigaev, Oleg Bartunov.
      Revised by me.  Comments were adjusted by Liudmila Mantrova.
      
      Discussion: https://postgr.es/m/fcc6fc6a-b497-f39a-923d-aa34d0c588e8%402ndQuadrant.com
      Discussion: https://postgr.es/m/CAPpHfdsZgYEra_PeCLGNoXOWYx6iU-S3wF8aX0ObQUcZU%2B4XTw%40mail.gmail.com
      Author: Nikita Glukhov, Teodor Sigaev, Oleg Bartunov, Alexander Korotkov, Liudmila Mantrova
      Reviewed-by: Anastasia Lubennikova, Peter Eisentraut
      6dda292d
    • Alexander Korotkov's avatar
      Error suppression support for upcoming jsonpath .datetime() method · 5bc45062
      Alexander Korotkov authored
      Add support of error suppression in some date and time manipulation functions
      as it's required for jsonpath .datetime() method support.  This commit doesn't
      use PG_TRY()/PG_CATCH() in order to implement that.  Instead, it provides
      internal versions of date and time functions used, which support error
      suppression.
      
      Discussion: https://postgr.es/m/CAPpHfdsZgYEra_PeCLGNoXOWYx6iU-S3wF8aX0ObQUcZU%2B4XTw%40mail.gmail.com
      Author: Alexander Korotkov, Nikita Glukhov
      Reviewed-by: Anastasia Lubennikova, Peter Eisentraut
      5bc45062
    • Alexander Korotkov's avatar
      Implement parse_datetime() function · 66c74f8b
      Alexander Korotkov authored
      This commit adds parse_datetime() function, which implements datetime
      parsing with extended features demanded by upcoming jsonpath .datetime()
      method:
      
       * Dynamic type identification based on template string,
       * Support for standard-conforming 'strict' mode,
       * Timezone offset is returned as separate value.
      
      Extracted from original patch by Nikita Glukhov, Teodor Sigaev, Oleg Bartunov.
      Revised by me.
      
      Discussion: https://postgr.es/m/fcc6fc6a-b497-f39a-923d-aa34d0c588e8%402ndQuadrant.com
      Discussion: https://postgr.es/m/CAPpHfdsZgYEra_PeCLGNoXOWYx6iU-S3wF8aX0ObQUcZU%2B4XTw%40mail.gmail.com
      Author: Nikita Glukhov, Teodor Sigaev, Oleg Bartunov, Alexander Korotkov
      Reviewed-by: Anastasia Lubennikova, Peter Eisentraut
      66c74f8b
    • Alexander Korotkov's avatar
      Implement standard datetime parsing mode · 1a950f37
      Alexander Korotkov authored
      SQL Standard 2016 defines rules for handling separators in datetime template
      strings, which are different to to_date()/to_timestamp() rules.  Standard
      allows only small set of separators and requires strict matching for them.
      
      Standard applies to jsonpath .datetime() method and CAST (... FORMAT ...) SQL
      clause.  We're not going to change handling of separators in existing
      to_date()/to_timestamp() functions, because their current behavior is familiar
      for users.  Standard behavior now available by special flag, which will be used
      in upcoming .datetime() jsonpath method.
      
      Discussion: https://postgr.es/m/CAPpHfdsZgYEra_PeCLGNoXOWYx6iU-S3wF8aX0ObQUcZU%2B4XTw%40mail.gmail.com
      Author: Alexander Korotkov
      1a950f37
    • Alvaro Herrera's avatar
      Update expected output for dummy_index_am · bd29cc19
      Alvaro Herrera authored
      Forgot to add the file in the previous commit.
      bd29cc19
    • Alvaro Herrera's avatar
      Support reloptions of enum type · 773df883
      Alvaro Herrera authored
      All our current in core relation options of type string (not many,
      admittedly) behave in reality like enums.  But after seeing an
      implementation for enum reloptions, it's clear that strings are messier,
      so introduce the new reloption type.  Switch all string options to be
      enums instead.
      
      Fortunately we have a recently introduced test module for reloptions, so
      we don't lose coverage of string reloptions, which may still be used by
      third-party modules.
      
      Authors: Nikolay Shaplov, Álvaro Herrera
      Reviewed-by: Nikita Glukhov, Aleksandr Parfenov
      Discussion: https://postgr.es/m/43332102.S2V5pIjXRx@x200m
      773df883