Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hnoJU-0001cq-6U for pgsql-general@arkaria.postgresql.org; Wed, 17 Jul 2019 18:06:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hnoJR-00012G-TB for pgsql-general@arkaria.postgresql.org; Wed, 17 Jul 2019 18:05:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hnoFB-0001RZ-Px for pgsql-general@lists.postgresql.org; Wed, 17 Jul 2019 18:01:33 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hnoF7-00044v-VE for pgsql-general@postgresql.org; Wed, 17 Jul 2019 18:01:33 +0000 Received: by mail-qt1-x841.google.com with SMTP id h18so24291827qtm.9 for ; Wed, 17 Jul 2019 11:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=R+DdbZt/1axLfCjHyiZ/MNf40Rx+Ou3QuEuQ0+zL0FY=; b=yN9q2msIEl38LYUc85e0bekKsW117QpgVUxtybZbP4kQiYwZJMolHQC5VagpLh200a +cB1UrDBr8uilqA+VtjKMFsA07CiV4KKb58rM0utPXvXH1FUJLtGtrSmF+3KXNSdQ8lN rJVodgqs1SHhg2Bp27Fa0QhdYf8rLKSdQTIJi1vBc5f1ZBGQjlpuFeLlCbT8akGFjj2A DD40DiMD3Jht+iQMhryPPxfhY72hhzujCOgcDGIk7V/nXwNlZQqhD45pAhCVHZzLCnCd j8/G8HgPLaz8sD3pyXPF9eiwphL6pBBfPA/PrbYK5ZBpBSqteByDRFxFDXHH13dBSkcG SdYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=R+DdbZt/1axLfCjHyiZ/MNf40Rx+Ou3QuEuQ0+zL0FY=; b=ZehayBaco9hMEIDcTufrlfrAnPtbapwgTAd78UboJpQV9HLQL7u3J06+VmHjidlLlT bJPMZzZ+w8+Rr3TVGCU/yrduH7e7+xC5DhAxSu/umOr2HI/MQrCNIvpmYDap/Vd5uq4m 1QGujKKyRkSB8eTHf/wj0k68OHUXVGq8lM0dF6T/ZGUAT9fwXZvbs9xLcqBagot4QaDL bRCBUCXDS7Mz7DAI9TWoHflwGhFnNvgqPBvYrRhsgW36z/vwfQkZ8CLxE5L+1KHoUo4A 5fGXk77DONZjTZHz3Qw4yjFF9jDDHSyAxHy6aFEVUPMS5Zf/1ApC5ey0/S9jXF/b9+48 mJlw== X-Gm-Message-State: APjAAAUU13qRHWPZiHdtVsEeMyodJ2NUuW4I+3w0uxl9TTxgMB7Qj/KY 9MNcfHKjQ5nFGMYYNZVQ/NQ8DQ== X-Google-Smtp-Source: APXvYqz0GbS1GrTtF6kCpkRYkxtexqkVzI/FQmUQ6tyMOFYgOIclG/e1EeTikMZX/lFyCMcb3l6sfQ== X-Received: by 2002:ac8:41ce:: with SMTP id o14mr27751165qtm.92.1563386488724; Wed, 17 Jul 2019 11:01:28 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([177.154.139.198]) by smtp.gmail.com with ESMTPSA id r26sm10934722qkm.57.2019.07.17.11.01.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 17 Jul 2019 11:01:27 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 88A921249EE; Mon, 15 Jul 2019 12:09:26 -0400 (-04) Date: Mon, 15 Jul 2019 12:09:26 -0400 From: Alvaro Herrera To: Tom Lane Cc: Adrian Klaver , Emanuel =?iso-8859-1?Q?Ara=FAjo?= , pgsql-general@postgresql.org Subject: Re: disable and enable trigger all when a foreign keys Message-ID: <20190715160926.GA17140@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <28189.1562942593@sss.pgh.pa.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jul-12, Tom Lane wrote: > The OP already found the best method to get out of this, which is to > drop and re-add the FK constraint. Adding the constraint will force > a full verification scan, which is what you need here since there's > no information available about which checks were missed. Maybe it would make sense to be able to mark the FK as not validated, so that you can apply ALTER CONSTRAINT ... VALIDATE. Seems better than DROP + ADD. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services