1. 18 Sep, 2019 1 commit
  2. 06 Sep, 2019 8 commits
  3. 12 Jul, 2019 1 commit
    • David Rowley's avatar
      Fix RANGE partition pruning with multiple boolean partition keys · cfde2349
      David Rowley authored
      match_clause_to_partition_key incorrectly would return
      PARTCLAUSE_UNSUPPORTED if a bool qual could not be matched to the current
      partition key.  This was a problem, as it causes the calling function to
      discard the qual and not try to match it to any other partition key.  If
      there was another partition key which did match this qual, then the qual
      would not be checked again and we could fail to prune some partitions.
      The worst this could do was to cause partitions not to be pruned when they
      could have been, so there was no danger of incorrect query results here.
      Fix this by changing match_boolean_partition_clause to have it return a
      PartClauseMatchStatus rather than a boolean value.  This allows it to
      communicate if the qual is unsupported or if it just does not match this
      particular partition key, previously these two cases were treated the
      same.  Now, if match_clause_to_partition_key is unable to match the qual
      to any other qual type then we can simply return the value from the
      match_boolean_partition_clause call so that the calling function properly
      treats the qual as either unmatched or unsupported.
      Reported-by: Rares Salcudean
      Reviewed-by: Amit Langote
      Backpatch-through: 11 where partition pruning was introduced
      Discussion: https://postgr.es/m/[email protected]om
  4. 11 Jul, 2019 1 commit
  5. 10 Jul, 2019 7 commits
    • Tom Lane's avatar
      Reduce memory consumption for multi-statement query strings. · b5810de3
      Tom Lane authored
      Previously, exec_simple_query always ran parse analysis, rewrite, and
      planning in MessageContext, allowing all the data generated thereby
      to persist until the end of processing of the whole query string.
      That's fine for single-command strings, but if a client sends many
      commands in a single simple-Query message, this strategy could result
      in annoying memory bloat, as complained of by Andreas Seltenreich.
      To fix, create a child context to do this work in, and reclaim it
      after each command.  But we only do so for parsetrees that are not
      last in their query string.  That avoids adding any memory management
      overhead for the typical case of a single-command string.  Memory
      allocated for the last parsetree would be freed immediately after
      finishing the command string anyway.
      Similarly, adjust extension.c's execute_sql_string() to reclaim memory
      after each command.  In that usage, multi-command strings are the norm,
      so it's a bit surprising that no one has yet complained of bloat ---
      especially since the bloat extended to whatever data ProcessUtility
      execution might leak.
      Amit Langote, reviewed by Julien Rouhaud
      Discussion: https://postgr.es/m/[email protected]
    • Bruce Momjian's avatar
      docs: remove pg_roles mention of the oid column being displayed · 909a7b6b
      Bruce Momjian authored
      It is now always displayed in PG 12+.
      Discussion: https://postgr.es/m/[email protected]
      Author: Ian Barwick
      Backpatch-through: 12
    • Alvaro Herrera's avatar
      Mention limitation of unique in partitioned tables · ec4eaab7
      Alvaro Herrera authored
      Per gripe from Phil Bayer.
      Authors: Amit Langote and others
      Discussion: https://postgr.es/m/[email protected]
    • Michael Paquier's avatar
      Fix variable initialization when using buffering build with GiST · fa19a08d
      Michael Paquier authored
      This can cause valgrind to complain, as the flag marking a buffer as a
      temporary copy was not getting initialized.
      While on it, fill in with zeros newly-created buffer pages.  This does
      not matter when loading a block from a temporary file, but it makes the
      push of an index tuple into a new buffer page safer.
      This has been introduced by 1d27dcf5, so backpatch all the way down to
      Author: Alexander Lakhin
      Discussion: https://postgr.es/m/[email protected]
      Backpatch-through: 9.4
    • Alexander Korotkov's avatar
      Assorted fixes for jsonpath documentation · 5a7d697a
      Alexander Korotkov authored
      This commit contains assorted fixes for jsonpath documentation including:
      grammar fixes, incorrect examples fixes as well as wording improvements.
      Discussion: https://postgr.es/m/CAA-aLv4VVX%3Db9RK5hkfPXJczqaiTdqO04teW9i0wiQVhdKcqzw%40mail.gmail.com
      Author: Liudmila Mantrova
      Reviewed-by: Alexander Korotkov
      Reported-by: Thom Brown
    • David Rowley's avatar
      Fix missing calls to table_finish_bulk_insert during COPY, take 2 · f7c830f1
      David Rowley authored
      86b85044 abstracted calls to heap functions in COPY FROM to support a
      generic table AM.  However, when performing a copy into a partitioned
      table, this commit neglected to call table_finish_bulk_insert for each
      partition.  Before 86b85044, when we always called the heap functions,
      there was no need to call heapam_finish_bulk_insert for partitions since
      it only did any work when performing a copy without WAL.  For partitioned
      tables, this was unsupported anyway, so there was no issue.  With
      pluggable storage, we can't make any assumptions about what the table AM
      might want to do in its equivalent function, so we'd better ensure we
      always call table_finish_bulk_insert each partition that's received a row.
      For now, we make the table_finish_bulk_insert call whenever we evict a
      CopyMultiInsertBuffer out of the CopyMultiInsertInfo.  This does mean
      that it's possible that we call table_finish_bulk_insert multiple times
      per partition, which is not a problem other than being an inefficiency.
      Improving this requires a more invasive patch, so let's leave that for
      another day.
      This also changes things so that we no longer needlessly call
      table_finish_bulk_insert when performing a COPY FROM for a non-partitioned
      table when not using multi-inserts.
      Reported-by: Robert Haas
      Backpatch-through: 12
      Discussion: https://postgr.es/m/[email protected]om
    • Amit Kapila's avatar
      Fix few typos and minor wordsmithing in tableam comments. · bd56cd75
      Amit Kapila authored
      Reported-by: Ashwin Agrawal
      Author: Ashwin Agrawal
      Reviewed-by: Amit Kapila
      Backpatch-through: 12, where it was introduced
      Discussion: https://postgr.es/m/[email protected]om
  6. 09 Jul, 2019 5 commits
  7. 08 Jul, 2019 5 commits
  8. 07 Jul, 2019 2 commits
  9. 06 Jul, 2019 5 commits
  10. 05 Jul, 2019 5 commits
    • Tom Lane's avatar
      Remove unreferenced function declarations. · 79b94716
      Tom Lane authored
      These seem to be leftovers from old patches, perhaps.
      Masahiko Sawada
      Discussion: https://postgr.es/m/[email protected]om
    • Tom Lane's avatar
      Remove dead encoding-conversion functions. · 0ab1a2e3
      Tom Lane authored
      The code for conversions SQL_ASCII <-> MULE_INTERNAL and
      SQL_ASCII <-> UTF8 was unreachable, because we long ago changed
      the wrapper functions pg_do_encoding_conversion() et al so that
      they have hard-wired behaviors for conversions involving SQL_ASCII.
      (At least some of those fast paths date back to 2002, though it
      looks like we may not have been totally consistent about this until
      later.)  Given the lack of complaints, nobody is dissatisfied with
      this state of affairs.  Hence, let's just remove the unreachable code.
      Also, change CREATE CONVERSION so that it rejects attempts to
      define such conversions.  Since we consider that SQL_ASCII represents
      lack of knowledge about the encoding in use, such a conversion would
      be semantically dubious even if it were reachable.
      Adjust a couple of regression test cases that had randomly decided
      to rely on these conversion functions rather than any other ones.
      Discussion: https://postgr.es/m/[email protected]
    • Tomas Vondra's avatar
      Remove unused variable in statext_mcv_serialize() · ef777cb0
      Tomas Vondra authored
      The itemlen variable used to be referenced in multiple places, but since
      reworking the serialization code it's used only in one assert. Fixed by
      removing the variable and calling the macro from the assert directly.
      Backpatch to 12, where this code was introduced.
      Reported-by: Jeff Janes
      Discussion: https://postgr.es/m/[email protected]om
    • Tom Lane's avatar
      Add \warn command to psql. · 02e95a50
      Tom Lane authored
      This is like \echo except that the text is sent to stderr not stdout.
      In passing, fix a pre-existing bug in \echo and \qecho: per documentation
      the -n switch should only be recognized when it is the first argument,
      but actually any argument matching "-n" was treated as a switch.
      (Should we back-patch that?)
      David Fetter (bug fix by me), reviewed by Fabien Coelho
      Discussion: https://postgr.es/m/[email protected]
    • Thomas Munro's avatar
      Improve comment in postgresql.conf.sample. · e8fdcacc
      Thomas Munro authored
      The Unix manual section that "man tcp" appears in varies, so let's
      just leave it out of the command to run.