1. 14 Jul, 2020 5 commits
  2. 13 Jul, 2020 7 commits
  3. 12 Jul, 2020 2 commits
    • Michael Paquier's avatar
      Fix test failure with -DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS · ea3e15d1
      Michael Paquier authored
      Replication origins created by regression tests should have names
      starting with "regress_", and the test introduced in b1e48bbe for commit
      timestamps did not do that.
      
      Per buildfarm member longfin.
      
      Discussion: https://postgr.es/m/20200712122507.GD21680@paquier.xyz
      ea3e15d1
    • Michael Paquier's avatar
      Include replication origins in SQL functions for commit timestamp · b1e48bbe
      Michael Paquier authored
      This includes two changes:
      - Addition of a new function pg_xact_commit_timestamp_origin() able, for
      a given transaction ID, to return the commit timestamp and replication
      origin of this transaction.  An equivalent function existed in
      pglogical.
      - Addition of the replication origin to pg_last_committed_xact().
      
      The commit timestamp manager includes already APIs able to return the
      replication origin of a transaction on top of its commit timestamp, but
      the code paths for replication origins were never stressed as those
      functions have never looked for a replication origin, and the SQL
      functions available have never included this information since their
      introduction in 73c986ad.
      
      While on it, refactor a test of modules/commit_ts/ to use tstzrange() to
      check that a transaction timestamp is within the wanted range, making
      the test a bit easier to read.
      
      Bump catalog version.
      
      Author: Movead Li
      Reviewed-by: Madan Kumar, Michael Paquier
      Discussion: https://postgr.es/m/2020051116430836450630@highgo.ca
      b1e48bbe
  4. 11 Jul, 2020 6 commits
    • Tom Lane's avatar
      Avoid useless buffer allocations during binary COPY FROM. · cd22d3cd
      Tom Lane authored
      The raw_buf and line_buf buffers aren't used when reading binary format,
      so skip allocating them.  raw_buf is 64K so that seems like a worthwhile
      savings.  An unused line_buf only wastes 1K, but as long as we're checking
      it's free to avoid allocating that too.
      
      Bharath Rupireddy, tweaked a bit by me
      
      Discussion: https://postgr.es/m/CALj2ACXcCKaGPY0whowqrJ4OPJvDnTssgpGCzvuFQu5z0CXb-g@mail.gmail.com
      cd22d3cd
    • Tom Lane's avatar
      Avoid trying to restore table ACLs and per-column ACLs in parallel. · ea912530
      Tom Lane authored
      Parallel pg_restore has always supposed that ACL items for different
      objects are independent and can be restored in parallel without
      conflicts.  However, there is one case where this fails: because
      REVOKE on a table is defined to also revoke the privilege(s) at
      column level, we can't restore per-column ACLs till after we restore
      any table-level privileges on their table.  Failure to honor this
      restriction can lead to "tuple concurrently updated" errors during
      parallel restore, or even to the per-column ACLs silently disappearing
      because the table-level REVOKE is executed afterwards.
      
      To fix, add a dependency from each column-level ACL item to its table's
      ACL item, if there is one.  Note that this doesn't fix the hazard
      for pre-existing archive files, only for ones made with a corrected
      pg_dump.  Given that the bug's been there quite awhile without
      field reports, I think this is acceptable.
      
      This requires changing the API of pg_dump's dumpACL() function.
      To keep its argument list from getting even longer, I removed the
      "CatalogId objCatId" argument, which has been unused for ages.
      
      Per report from Justin Pryzby.  Back-patch to all supported branches.
      
      Discussion: https://postgr.es/m/20200706050129.GW4107@telsasoft.com
      ea912530
    • Peter Eisentraut's avatar
    • Michael Paquier's avatar
      Rename field "relkind" to "objtype" for CTAS and ALTER TABLE nodes · cc35d893
      Michael Paquier authored
      "relkind" normally refers to the char field from pg_class.  However, in
      the parse nodes AlterTableStmt and CreateTableAsStmt, "relkind" was used
      for a field of type enum ObjectType, that could refer to other object
      types than those possible for a relkind.  Such fields being usually
      named "objtype", switch the name in both structures to make things more
      consistent.  Note that this led to some confusion in functions that
      also operate on a RangeTableEntry object, which also has a field named
      "relkind".
      
      This naming goes back to commit 09d4e96d, where only OBJECT_TABLE and
      OBJECT_INDEX were used.  This got extended later to use as well
      OBJECT_TYPE with e440e12c, not really a relation kind.
      
      Author: Mark Dilger
      Reviewed-by: Daniel Gustafsson, Álvaro Herrera, Michael Paquier
      Discussion: https://postgr.es/m/609181AE-E399-47C7-9221-856E0F96BF93@enterprisedb.com
      cc35d893
    • Alexander Korotkov's avatar
      Forbid numeric NaN in jsonpath · df646509
      Alexander Korotkov authored
      SQL standard doesn't define numeric Inf or NaN values.  It appears even more
      ridiculous to support then in jsonpath assuming JSON doesn't support these
      values as well.  This commit forbids returning NaN from .double(), which was
      previously allowed.  NaN can't be result of inner-jsonpath computation over
      non-NaNs.  So, we can not expect NaN in the jsonpath output.
      
      Reported-by: Tom Lane
      Discussion: https://postgr.es/m/203949.1591879542%40sss.pgh.pa.us
      Author: Alexander Korotkov
      Reviewed-by: Tom Lane
      Backpatch-through: 12
      df646509
    • Alexander Korotkov's avatar
      Improve error reporting for jsonpath .double() method · 06571811
      Alexander Korotkov authored
      When jsonpath .double() method detects that numeric or string can't be
      converted to double precision, it throws an error.  This commit makes these
      errors explicitly express the reason of failure.
      
      Discussion: https://postgr.es/m/CAPpHfdtqJtiSXkP7tOXez18NxhLUH_-75bL8%3DOce4Ki%2Bbv7V6Q%40mail.gmail.com
      Author: Alexander Korotkov
      Reviewed-by: Tom Lane
      Backpatch-through: 12
      06571811
  5. 10 Jul, 2020 5 commits
  6. 09 Jul, 2020 5 commits
  7. 08 Jul, 2020 10 commits