1. 11 Jul, 2020 1 commit
  2. 10 Jul, 2020 5 commits
  3. 09 Jul, 2020 5 commits
  4. 08 Jul, 2020 15 commits
  5. 07 Jul, 2020 5 commits
    • Tom Lane's avatar
      Un-break pg_upgrade from pre-v12 servers. · 3f96af46
      Tom Lane authored
      I neglected to test this scenario while preparing commit f3faf35f,
      so of course it was broken, thanks to some very obscure and undocumented
      code in pg_dump.  Pre-v12 databases might have toast tables attached to
      partitioned tables, which we need to ignore since newer servers never
      create such useless toast tables.  There was a filter for this case in
      binary_upgrade_set_type_oids_by_rel_oid(), which appeared to just
      prevent the pg_type OID from being copied.  But actually it managed to
      prevent the toast table from being created at all --- or it did before
      I took out that logic.  But that was a fundamentally bizarre place to be
      making the test in the first place.  The place where the filter should
      have been, one would think, is binary_upgrade_set_pg_class_oids(), so
      add it there.
      
      While at it, reorganize binary_upgrade_set_pg_class_oids() so that it
      doesn't make a completely useless query when it knows it's being
      invoked for an index.  And correct a comment that mis-described the
      scenario where we need to force creation of a TOAST table.
      
      Per buildfarm.
      3f96af46
    • Tom Lane's avatar
      Don't create pg_type entries for sequences or toast tables. · f3faf35f
      Tom Lane authored
      Commit f7f70d5e left one inconsistency behind: we're still creating
      pg_type entries for the composite types of sequences and toast tables,
      but not arrays over those composites.  But there seems precious little
      reason to have named composite types for toast tables, and not much more
      to have them for sequences (especially given the thought that sequences
      may someday not be standalone relations at all).
      
      So, let's close that inconsistency by removing these composite types,
      rather than adding arrays for them.  This buys back a little bit of
      the initial pg_type bloat added by the previous patch, and could be
      a significant savings in a large database with many toast tables.
      
      Aside from a small logic rearrangement in heap_create_with_catalog,
      this patch mostly needs to clean up some places that were assuming that
      pg_class.reltype always has a valid value.  Those are really pre-existing
      bugs, given that it's documented otherwise; notably, the plpgsql changes
      fix code that gives "cache lookup failed for type 0" on indexes today.
      But none of these seem interesting enough to back-patch.
      
      Also, remove the pg_dump/pg_upgrade infrastructure for propagating
      a toast table's pg_type OID into the new database, since we no longer
      need that.
      
      Discussion: https://postgr.es/m/761F1389-C6A8-4C15-80CE-950C961F5341@gmail.com
      f3faf35f
    • Alvaro Herrera's avatar
      Morph pg_replication_slots.min_safe_lsn to safe_wal_size · a8aaa0c7
      Alvaro Herrera authored
      The previous definition of the column was almost universally disliked,
      so provide this updated definition which is more useful for monitoring
      purposes: a large positive value is good, while zero or a negative value
      means danger.  This should be operationally more convenient.
      
      Backpatch to 13, where the new column to pg_replication_slots (and the
      feature it represents) were added.
      
      Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
      Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
      Reported-by: default avatarFujii Masao <masao.fujii@oss.nttdata.com>
      Discussion: https://postgr.es/m/9ddfbf8c-2f67-904d-44ed-cf8bc5916228@oss.nttdata.com
      a8aaa0c7
    • Magnus Hagander's avatar
      Check ssl_in_use flag when reporting statistics · 6a5c750f
      Magnus Hagander authored
      Previously we checked that the ssl pointer was not null, but this puts a
      requirement on there being such a pointer which may not be true in
      future multi-ssl-library supporting times. This seems to have been an
      oversight in 9029f4b3, but hasn't really had any effect since we only
      have one library.
      
      Author: Daniel Gustafsson
      6a5c750f
    • Peter Eisentraut's avatar
      71ec58e7
  6. 06 Jul, 2020 9 commits
    • Peter Geoghegan's avatar
      Remove unnecessary PageIsEmpty() nbtree build check. · 28c16f49
      Peter Geoghegan authored
      nbtree index builds cannot write out an empty page.  That would mean
      that there was no way to create a pivot tuple pointing to the page one
      level up, since _bt_truncate() generates one based on page's firstright
      tuple.
      
      Replace the unnecessary PageIsEmpty() check with an assertion that
      checks that the page has space for at least two line pointers (the
      would-be high key line pointer, plus at least one valid "data item"
      tuple line pointer).
      
      The PageIsEmpty() check was added by commit 5d9f146c over 20 years ago.
      It looks like it has always been unnecessary.
      28c16f49
    • Tom Lane's avatar
      Create composite array types for initdb-created relations. · f7f70d5e
      Tom Lane authored
      When we invented arrays of composite types (commit bc8036fc),
      we excluded system catalogs, basically just on the grounds of not
      wanting to bloat pg_type.  However, it's definitely inconsistent that
      catalogs' composite types can't be put into arrays when others can.
      Another problem is that the exclusion is done by checking
      IsUnderPostmaster in heap_create_with_catalog, which means that
      
      (1) If a user tries to create a table in single-user mode, it doesn't
      get an array type.  That's bad in itself, plus it breaks pg_upgrade.
      
      (2) If someone drops and recreates a system view or information_schema
      view (as we occasionally recommend doing), it will now have an array
      type where it did not before, making for still more inconsistency.
      
      So this is all pretty messy.  Let's just get rid of the inconsistency
      and decree that system-created relations should have array types if
      similar user-created ones would, i.e. it only depends on the relkind.
      As of HEAD, that means that the initial contents of pg_type grow from
      411 rows to 605, which is a lot of growth percentage-wise, but it's
      still quite a small catalog compared to others.
      
      Wenjing Zeng, reviewed by Shawn Wang, further hacking by me
      
      Discussion: https://postgr.es/m/761F1389-C6A8-4C15-80CE-950C961F5341@gmail.com
      f7f70d5e
    • Peter Eisentraut's avatar
      Fix typo in test · bae9e8a5
      Peter Eisentraut authored
      The test was supposed to error but didn't.  Apparently, a copy and
      paste and string replace mistake from a nearby similar test.
      bae9e8a5
    • Fujii Masao's avatar
      doc: Add note about possible performance overhead by enabling track_planning. · 321fa6a4
      Fujii Masao authored
      Enabling pg_stat_statements.track_plaanning may incur a noticeable
      performance penalty, especially when a fewer kinds of queries are executed
      on many concurrent connections. This commit documents this note.
      
      Back-patch to v13 where pg_stat_statements.track_plaanning was added.
      
      Suggested-by: Pavel Stehule
      Author: Fujii Masao
      Reviewed-by: Pavel Stehule
      Discussion: https://postgr.es/m/CAFj8pRC9Jxa8r5i0TNBWLb8mzuaYzEoLq3QOvip0jVpHPOLbVA@mail.gmail.com
      321fa6a4
    • Michael Paquier's avatar
      Refactor routines for name lookups of procedures and operators · aa384348
      Michael Paquier authored
      This introduces a new set of extended routines for procedure and
      operator name lookups, with a flag bitmask argument that can modify the
      result.  The following options are available:
      - Force schema qualification, ignoring search_path.  This is similar to
      the existing option for format_{operator|procedure}_qualified().
      - Force NULL as result instead of a numeric OID for an undefined
      object.  This option is new.
      
      This is a refactoring similar to 1185c782, that will be used for a future
      patch to improve the SQL functions providing information using object
      addresses for undefined objects.
      
      Author: Michael Paquier
      Reviewed-by: Aleksander Alekseev, Dmitry Dolgov, Daniel Gustafsson,
      Álvaro Herrera
      Discussion: https://postgr.es/m/CAB7nPqSZxrSmdHK-rny7z8mi=EAFXJ5J-0RbzDw6aus=wB5azQ@mail.gmail.com
      aa384348
    • Amit Kapila's avatar
      Remove extra whitespace in comments atop ReorderBufferCheckMemoryLimit. · 04c7f414
      Amit Kapila authored
      Backpatch-through: 13, where it was introduced
      04c7f414
    • Michael Paquier's avatar
      Add new flag to format_type_extended() to get NULL for undefined type · 1185c782
      Michael Paquier authored
      If a type scanned is undefined, type format routines have two behaviors
      depending on if FORMAT_TYPE_ALLOW_INVALID is used by the caller or not:
      - Issue a cache lookup error
      - Return an undefined type name "???", "???[]" or "-"
      
      The current interface is not really helpful for callers willing to
      format properly a type name, but still make sure that the type is
      defined as there could be types matching the strings generated when
      looking for an undefined type, even if that should not be a problem in
      practice.  In order to counter that, add a new flag called
      FORMAT_TYPE_INVALID_AS_NULL that returns a NULL result instead of "???
      or "-" which does not generate an error.  This flag will be used in a
      follow-up patch improving the set of SQL functions showing information
      for object addresses when it comes to undefined objects.
      
      Author: Michael Paquier
      Reviewed-by: Aleksander Alekseev, Dmitry Dolgov, Daniel Gustafsson,
      Álvaro Herrera
      Discussion: https://postgr.es/m/CAB7nPqSZxrSmdHK-rny7z8mi=EAFXJ5J-0RbzDw6aus=wB5azQ@mail.gmail.com
      1185c782
    • Amit Kapila's avatar
      Remove unused function parameter in end_parallel_vacuum. · 231ef5b9
      Amit Kapila authored
      Author: Vignesh C
      Reviewed-by: Sawada Masahiko
      Backpatch-through: 13, where it was introduced
      Discussion: https://postgr.es/m/CALDaNm3Ppt71NafGY5mk3V2i3Q+mm93pVibDq-0NpW7WU67Jcg@mail.gmail.com
      231ef5b9
    • Michael Paquier's avatar
      Improve perl script in MSVC to build binaries · 404b912c
      Michael Paquier authored
      This commit includes two improvements for build.pl in src/tools/msvc/:
      - Fix two warnings related to $ARGV[0] being uninitialized, something
      that happens when calling build.pl (or build.bat) without arguments to
      compile all the components with a release quality.
      - If calling the script with more than two arguments, exit immediately
      and show a new help output.  build.pl was not failing in this case
      before this commit, and the extra arguments were just ignored, but the
      new behavior helps in understanding how to run the script without
      looking at the documentation for the Windows builds.
      
      Reported-by: Ranier Vilela
      Author: Michael Paquier
      Reviewed-by: Juan José Santamaría Flecha, David Zhang
      Discussion: https://postgr.es/m/CAEudQAo38dfR_0Ugt2OHy4mq-6Hz93XPSBAGEUV67RhKdgp8Zg@mail.gmail.com
      404b912c