1. 12 Jun, 2019 5 commits
    • David Rowley's avatar
      doc: Fix grammatical error in partitioning docs · ddc053dc
      David Rowley authored
      Reported-by: Amit Langote
      Discussion: https://postgr.es/m/CA+HiwqGZFkKi0TkBGYpr2_5qrRAbHZoP47AP1BRLUOUkfQdy_A@mail.gmail.com
      Backpatch-through: 10
      ddc053dc
    • Bruce Momjian's avatar
    • Bruce Momjian's avatar
    • Tom Lane's avatar
      Fix ALTER COLUMN TYPE failure with a partial exclusion constraint. · e76de886
      Tom Lane authored
      ATExecAlterColumnType failed to consider the possibility that an index
      that needs to be rebuilt might be a child of a constraint that needs to be
      rebuilt.  We missed this so far because usually a constraint index doesn't
      have a direct dependency on its table, just on the constraint object.
      But if there's a WHERE clause, then dependency analysis of the WHERE
      clause results in direct dependencies on the column(s) mentioned in WHERE.
      This led to trying to drop and rebuild both the constraint and its
      underlying index.
      
      In v11/HEAD, we successfully drop both the index and the constraint,
      and then try to rebuild both, and of course the second rebuild hits a
      duplicate-index-name problem.  Before v11, it fails with obscure messages
      about a missing relation OID, due to trying to drop the index twice.
      
      This is essentially the same kind of problem noted in commit
      20bef2c3: the possible dependency linkages are broader than what
      ATExecAlterColumnType was designed for.  It was probably OK when
      written, but it's certainly been broken since the introduction of
      partial exclusion constraints.  Fix by adding an explicit check
      for whether any of the indexes-to-be-rebuilt belong to any of the
      constraints-to-be-rebuilt, and ignoring any that do.
      
      In passing, fix a latent bug introduced by commit 8b08f7d4: in
      get_constraint_index() we must "continue" not "break" when rejecting
      a relation of a wrong relkind.  This is harmless today because we don't
      expect that code path to be taken anyway; but if there ever were any
      relations to be ignored, the existing coding would have an extremely
      undesirable dependency on the order of pg_depend entries.
      
      Also adjust a couple of obsolete comments.
      
      Per bug #15835 from Yaroslav Schekin.  Back-patch to all supported
      branches.
      
      Discussion: https://postgr.es/m/15835-32d9b7a76c06a7a9@postgresql.org
      e76de886
    • Michael Paquier's avatar
      Fix handling of COMMENT for domain constraints · ceac4505
      Michael Paquier authored
      For a non-superuser, changing a comment on a domain constraint was
      leading to a cache lookup failure as the code tried to perform the
      ownership lookup on the constraint OID itself, thinking that it was a
      type, but this check needs to happen on the type the domain constraint
      relies on.  As the type a domain constraint relies on can be guessed
      directly based on the constraint OID, first fetch its type OID and
      perform the ownership on it.
      
      This is broken since 7eca575d, which has split the handling of comments
      for table constraints and domain constraints, so back-patch down to
      9.5.
      
      Reported-by: Clemens Ladisch
      Author: Daniel Gustafsson, Michael Paquier
      Reviewed-by: Álvaro Herrera
      Discussion: https://postgr.es/m/15833-808e11904835d26f@postgresql.org
      Backpatch-through: 9.5
      ceac4505
  2. 11 Jun, 2019 7 commits
  3. 10 Jun, 2019 4 commits
  4. 09 Jun, 2019 4 commits
  5. 08 Jun, 2019 5 commits
  6. 07 Jun, 2019 3 commits
  7. 06 Jun, 2019 6 commits
  8. 05 Jun, 2019 4 commits
  9. 04 Jun, 2019 2 commits