1. 22 Jan, 2019 5 commits
  2. 21 Jan, 2019 17 commits
  3. 19 Jan, 2019 4 commits
  4. 18 Jan, 2019 12 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
    • Peter Eisentraut's avatar
      Remove obsolete comment · f04ad77a
      Peter Eisentraut authored
      f04ad77a
    • Peter Eisentraut's avatar
      configure: More use of AC_ARG_VAR · 29b3ac75
      Peter Eisentraut authored
      AC_ARG_VAR is necessary if an environment variable influences a
      configure result that is then used by other tests that are cached.
      With AC_ARG_VAR, a change in the variable is detected on subsequent
      configure runs and the user is then advised to remove the cache.
      
      This adds AC_ARG_VAR calls for: MSGFMT, PERL, PYTHON, TCLSH, XML2_CONFIG
      Reviewed-by: default avatarTom Lane <tgl@sss.pgh.pa.us>
      Discussion: https://www.postgresql.org/message-id/30672.1546816567@sss.pgh.pa.us
      29b3ac75
    • Michael Paquier's avatar
    • Michael Paquier's avatar
      Enforce non-parallel plan when calling current_schema() in newly-added test · 396676b0
      Michael Paquier authored
      current_schema() gets called in the recently-added regression test from
      c5660e0a, and can be used in a parallel context, causing its call to fail
      when creating a temporary schema.
      
      Per buildfarm members crake and lapwing.
      
      Discussion: https://postgr.es/m/20190118005949.GD1883@paquier.xyz
      396676b0
    • Tom Lane's avatar
      Avoid assuming that we know the spelling of getopt_long's error messages. · 251f5746
      Tom Lane authored
      I've had enough of "fixing" this test case.  Whatever value it has
      is limited to verifying that pgbench fails for an unrecognized switch,
      and we don't need to assume anything about what getopt_long prints in
      order to do that.
      
      Discussion: https://postgr.es/m/9427.1547701450@sss.pgh.pa.us
      251f5746
    • Michael Paquier's avatar
      Restrict the use of temporary namespace in two-phase transactions · c5660e0a
      Michael Paquier authored
      Attempting to use a temporary table within a two-phase transaction is
      forbidden for ages.  However, there have been uncovered grounds for
      a couple of other object types and commands which work on temporary
      objects with two-phase commit.  In short, trying to create, lock or drop
      an object on a temporary schema should not be authorized within a
      two-phase transaction, as it would cause its state to create
      dependencies with other sessions, causing all sorts of side effects with
      the existing session or other sessions spawned later on trying to use
      the same temporary schema name.
      
      Regression tests are added to cover all the grounds found, the original
      report mentioned function creation, but monitoring closer there are many
      other patterns with LOCK, DROP or CREATE EXTENSION which are involved.
      One of the symptoms resulting in combining both is that the session
      which used the temporary schema is not able to shut down completely,
      waiting for being able to drop the temporary schema, something that it
      cannot complete because of the two-phase transaction involved with
      temporary objects.  In this case the client is able to disconnect but
      the session remains alive on the backend-side, potentially blocking
      connection backend slots from being used.  Other problems reported could
      also involve server crashes.
      
      This is back-patched down to v10, which is where 9b013dc2 has introduced
      MyXactFlags, something that this patch relies on.
      
      Reported-by: Alexey Bashtanov
      Author: Michael Paquier
      Reviewed-by: Masahiko Sawada
      Discussion: https://postgr.es/m/5d910e2e-0db8-ec06-dd5f-baec420513c3@imap.cc
      Backpatch-through: 10
      c5660e0a
  5. 17 Jan, 2019 2 commits