1. 08 May, 2021 3 commits
    • Tom Lane's avatar
      Sync guc.c and postgresql.conf.sample with the SGML docs. · a55a9847
      Tom Lane authored
      It seems that various people have moved GUCs around in the config.sgml
      listing without bothering to make the code agree.  Ensure that the
      config_group codes assigned to GUCs match where they are listed in
      config.sgml.  Likewise ensure that postgresql.conf.sample lists GUCs
      in the same sub-section and same ordering as they appear in config.sgml.
      
      (I've got some doubts about some of these choices, but for the purposes
      of this patch, we'll treat config.sgml as gospel.)
      
      Notably, this requires adding a WAL_RECOVERY config_group value,
      because 1d257577 didn't.  As long as we're renumbering that enum
      anyway, let's take out the values corresponding to major groups
      that are divided into sub-groups.  No GUC should be assigned to the
      major group itself, so those values just create a temptation to
      do the wrong thing, while adding work for translators.
      
      In passing, adjust the short_desc strings for PRESET_OPTIONS GUCs
      to uniformly use the phrasing "Shows XYZ.", removing the impression
      some of these strings left that you can set the value.
      
      While some of these errors are old, no back-patch, as changing the
      contents of the pg_settings view in stable branches seems more likely
      to be seen as a compatibility break than anything helpful.
      
      Bharath Rupireddy, Justin Pryzby, Tom Lane
      
      Discussion: https://postgr.es/m/16997-ff16127f6e0d1390@postgresql.org
      Discussion: https://postgr.es/m/20210413123139.GE6091@telsasoft.com
      a55a9847
    • Tom Lane's avatar
      Doc: copy-editing for debug_invalidate_system_caches_always description. · f9b809e7
      Tom Lane authored
      I came to fix "useful only useful", but the more I looked at the text
      the more things I thought could be improved.
      f9b809e7
    • Michael Paquier's avatar
      Fix incorrect error code for CREATE/ALTER TABLE COMPRESSION · 9681f216
      Michael Paquier authored
      Specifying an incorrect value for the compression method of an attribute
      caused ERRCODE_FEATURE_NOT_SUPPORTED to be raised as error.  Use instead
      ERRCODE_INVALID_PARAMETER_VALUE to be more consistent.
      
      Author: Dilip Kumar
      Discussion: https://postgr.es/m/CAFiTN-vH84fE-8C4zGZw4v0Wyh4Y2v=5JWg2fGE5+LPaDvz1GQ@mail.gmail.com
      9681f216
  2. 07 May, 2021 11 commits
  3. 06 May, 2021 12 commits
  4. 05 May, 2021 4 commits
    • Alvaro Herrera's avatar
      Remove unused argument of ATAddForeignConstraint · c250062d
      Alvaro Herrera authored
      Commit 0325d7a5 made this unused but forgot to remove it. Do so now.
      
      Author: Amit Langote <amitlangote09@gmail.com>
      Discussion: https://postgr.es/m/209c99fe-b9a2-94f4-cd68-a8304186a09e@lab.ntt.co.jp
      c250062d
    • Alvaro Herrera's avatar
      Have ALTER CONSTRAINT recurse on partitioned tables · 6f70d7ca
      Alvaro Herrera authored
      When ALTER TABLE .. ALTER CONSTRAINT changes deferrability properties
      changed in a partitioned table, we failed to propagate those changes
      correctly to partitions and to triggers.  Repair by adding a recursion
      mechanism to affect all derived constraints and all derived triggers.
      (In particular, recurse to partitions even if their respective parents
      are already in the desired state: it is possible for the partitions to
      have been altered individually.)  Because foreign keys involve tables in
      two sides, we cannot use the standard ALTER TABLE recursion mechanism,
      so we invent our own by following pg_constraint.conparentid down.
      
      When ALTER TABLE .. ALTER CONSTRAINT is invoked on the derived
      pg_constraint object that's automaticaly created in a partition as a
      result of a constraint added to its parent, raise an error instead of
      pretending to work and then failing to modify all the affected triggers.
      Before this commit such a command would be allowed but failed to affect
      all triggers, so it would silently misbehave.  (Restoring dumps of
      existing databases is not affected, because pg_dump does not produce
      anything for such a derived constraint anyway.)
      
      Add some tests for the case.
      
      Backpatch to 11, where foreign key support was added to partitioned
      tables by commit 3de241db.  (A related change is commit f56f8f8d
      in pg12 which added support for FKs *referencing* partitioned tables;
      this is what forces us to use an ad-hoc recursion mechanism for this.)
      
      Diagnosed by Tom Lane from bug report from Ron L Johnson.  As of this
      writing, no reviews were offered.
      
      Discussion: https://postgr.es/m/75fe0761-a291-86a9-c8d8-4906da077469@gmail.com
      Discussion: https://postgr.es/m/3144850.1607369633@sss.pgh.pa.us
      6f70d7ca
    • Tom Lane's avatar
      Doc: improve and centralize the documentation for OID alias types. · f33a178a
      Tom Lane authored
      Previously, a lot of information about type regclass existed only
      in the discussion of the sequence functions.  Maybe that made sense
      in the beginning, because I think originally those were the only
      functions taking regclass.  But it doesn't make sense anymore.
      Move that material to the "Object Identifier Types" section in
      datatype.sgml, generalize it to talk about the other reg* types
      as well, and add more examples.
      
      Per bug #16991 from Federico Caselli.
      
      Discussion: https://postgr.es/m/16991-bcaeaafa17e0a723@postgresql.org
      f33a178a
    • Peter Eisentraut's avatar
      38f36aad
  5. 04 May, 2021 6 commits
  6. 03 May, 2021 4 commits
    • Bruce Momjian's avatar
      Update query_id computation · f7a97b6e
      Bruce Momjian authored
      Properly fix:
      
      - the "ONLY" in FROM [ONLY] isn't hashed
      - the agglevelsup field in GROUPING isn't hashed
      - WITH TIES not being hashed (new in PG 13)
      - "DISTINCT" in "GROUP BY [DISTINCT]" isn't hashed (new in PG 14)
      
      Reported-by: Julien Rouhaud
      
      Discussion: https://postgr.es/m/20210425081119.ulyzxqz23ueh3wuj@nol
      f7a97b6e
    • Peter Eisentraut's avatar
      doc: Add index entry for "multirange type" · 5df6aeab
      Peter Eisentraut authored
      Before now, looking up "multirange" in the index only led to the
      multirange() function.  To make this more useful, also add an entry
      pointing to the range types section.
      5df6aeab
    • Robert Haas's avatar
      amcheck: Improve some confusing reports about TOAST problems. · 50529e5b
      Robert Haas authored
      Don't phrase reports in terms of the number of tuples thus-far
      returned by the index scan, but rather in terms of the chunk_seq
      values found inside the tuples.
      
      Patch by me, reviewed by Mark Dilger.
      
      Discussion: http://postgr.es/m/CA+TgmoZUONCkdcdR778EKuE+f1r5Obieu63db2OgMPHaEvEPTQ@mail.gmail.com
      50529e5b
    • Tom Lane's avatar
      Fix performance issue in new regex match-all detection code. · f68970e3
      Tom Lane authored
      Commit 824bf719 introduced a new search of the NFAs generated by
      regex compilation.  I failed to think hard about the performance
      characteristics of that search, with the predictable outcome
      that it's bad: weird regexes can trigger exponential search time.
      Worse, there's no check-for-interrupt in that code, so you can't
      even cancel the query if this happens.
      
      Fix by introducing memo-ization of the search results, so that any one
      NFA state need be examined in detail just once.  This potentially uses
      a lot of memory, but we can bound the memory usage by putting a limit
      on the number of states for which we'll try to prove match-all-ness.
      That is sane because we already have a limit (DUPINF) on the maximum
      finite string length that a matchall regex can match; and patterns
      that involve much more than DUPINF states would probably exceed that
      limit anyway.
      
      Also, rearrange the logic so that we check the basic is-the-graph-
      all-RAINBOW-arcs property before we start the recursive search to
      determine path lengths.  This will ensure that we fall out quickly
      whenever the NFA couldn't possibly be matchall.
      
      Also stick in a check-for-interrupt, just in case these measures
      don't completely eliminate the risk of slowness.
      
      Discussion: https://postgr.es/m/3483895.1619898362@sss.pgh.pa.us
      f68970e3