1. 23 Jan, 2019 5 commits
  2. 22 Jan, 2019 8 commits
  3. 21 Jan, 2019 17 commits
  4. 19 Jan, 2019 4 commits
  5. 18 Jan, 2019 6 commits
    • Tom Lane's avatar
      Fix under-quoted filename pattern in pgbench TAP test. · 458a1244
      Tom Lane authored
      Avoids issues if build directory's pathname contains regex
      metacharacters.
      
      Raúl Marín Rodríguez
      
      Discussion: https://postgr.es/m/CAM6_UM6dGdU39PKAC24T+HD9ouy0jLN9vH6163K8QEEzr__iZw@mail.gmail.com
      458a1244
    • Tom Lane's avatar
      Use our own getopt() on OpenBSD. · 69bcd718
      Tom Lane authored
      Recent OpenBSD (at least 5.9 and up) has a version of getopt(3)
      that will not cope with the "-:" spec we use to accept double-dash
      options in postgres.c and postmaster.c.  Admittedly, that's a hack
      because POSIX only requires getopt() to allow alphanumeric option
      characters.  I have no desire to find another way, however, so
      let's just do what we were already doing on Solaris: force use
      of our own src/port/getopt.c implementation.
      
      In passing, improve some of the comments around said implementation.
      
      Per buildfarm and local testing.  Back-patch to all supported branches.
      
      Discussion: https://postgr.es/m/30197.1547835700@sss.pgh.pa.us
      69bcd718
    • Alvaro Herrera's avatar
      Fix creation of duplicate foreign keys on partitions · 0325d7a5
      Alvaro Herrera authored
      When creating a foreign key in a partitioned table, if some partitions
      already have equivalent constraints, we wastefully create duplicates of
      the constraints instead of attaching to the existing ones.  That's
      inconsistent with the de-duplication that is applied when a table is
      attached as a partition.  To fix, reuse the FK-cloning code instead of
      having a separate code path.
      
      Backpatch to Postgres 11.  This is a subtle behavior change, but surely
      a welcome one since there's no use in having duplicate foreign keys.
      
      Discovered by Álvaro Herrera while thinking about a different problem
      reported by Jesper Pedersen (bug #15587).
      
      Author: Álvaro Herrera
      Discussion: https://postgr.es/m/201901151935.zfadrzvyof4k@alvherre.pgsql
      0325d7a5
    • Alvaro Herrera's avatar
      Move CloneForeignKeyConstraints to tablecmds.c · 03afae20
      Alvaro Herrera authored
      My commit 3de241db introduced some code to create a clone of a
      foreign key to a partition, but I put it in pg_constraint.c because it
      was too close to the contents of the pg_constraint row.  With the
      previous commit that split out the constraint tuple deconstruction into
      its own routine, it makes more sense to have the FK-cloning function in
      tablecmds.c, mostly because its static subroutine can then be used by a
      future bugfix.
      
      My initial posting of this patch had this routine as static in
      tablecmds.c, but sadly this function is already part of the Postgres 11
      ABI as exported from pg_constraint.c, so keep it as exported also just
      to avoid breaking any possible users of it.
      03afae20
    • Alvaro Herrera's avatar
      Refactor duplicate code into DeconstructFkConstraintRow · 0080396d
      Alvaro Herrera authored
      My commit 3de241db introduced some code (in tablecmds.c) to obtain
      data from a pg_constraint row for a foreign key, that already existed in
      ri_triggers.c.  Split it out into its own routine in pg_constraint.c,
      where it naturally belongs.
      
      No functional code changes, only code movement.
      
      Backpatch to pg11, because a future bugfix is simpler after this.
      0080396d
    • Tom Lane's avatar
      Avoid sometimes printing both tables and their columns in DROP CASCADE. · 9194c427
      Tom Lane authored
      A cascaded drop might find independent reasons to drop both a table
      and some column of the table (for instance, a schema drop might include
      dropping a data type used in some table in the schema).  Depending on
      the order of visitation of pg_depend entries, we might report the
      table column and the whole table as separate objects-to-be-dropped,
      or we might only report the table.  This is confusing and leads to
      unstable regression test output, so fix it to report only the table
      regardless of visitation order.
      
      Per gripe from Peter Geoghegan.  This is just cosmetic from a user's
      standpoint, and we haven't actually seen regression test problems in
      practice (yet), so I'll refrain from back-patching.
      
      Discussion: https://postgr.es/m/15908.1547762076@sss.pgh.pa.us
      9194c427