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 1izpC0-0003I2-SV for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Feb 2020 22:00:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1izpBz-00021E-Ji for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Feb 2020 22:00:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1izpBz-00020y-8L for pgsql-bugs@lists.postgresql.org; Thu, 06 Feb 2020 22:00:11 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1izpBw-0007tc-OY for pgsql-bugs@lists.postgresql.org; Thu, 06 Feb 2020 22:00:09 +0000 Received: by mail-qt1-x841.google.com with SMTP id c5so338056qtj.6 for ; Thu, 06 Feb 2020 14:00:08 -0800 (PST) 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=nq8Zp+MnXj2+DzERhGDw4CuTrFD7qJq3/M18dKTokEU=; b=Ow8c47ttcPImQzLvaTLteEYYlpMPt4CavzWfWp9NK+1eikvT44vNyL2bSH//gGBNee e4fVdkUjXXctnDuObt6B4wVHT84xg3RwAOAq5jO/UkAeOLjZ8OlUo3Z1L/+CjVcBNr60 I1UAWm+169nSYcXvT8VQ6c1Wh42ZJJblwP2bpHi/7sz4SEnUu3/lsAZK3bPhyPi8mvZY yXFWUd5BTLR4XnsddSYMUEku6H2xFR2feh8bfOboZOiO21K4/kqn+p1RG9A/9+k/lQn2 /OzbYHsLxFLUt4F+YJvhnVOdV/5fNsxP8MS4prUg8uDtAHMIrkbeVmQX7Md/74yLn+iq W0Og== 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=nq8Zp+MnXj2+DzERhGDw4CuTrFD7qJq3/M18dKTokEU=; b=NQIsfvFfA7cRGhp8azlr+PylCh761Ql6lyLq5UB81XlXo2nI3wOnjenpAGPKMWzPuB cwsgFL5Pep0T4fpGAJi9hWOWILqb0B0jHKRCpgYtp0hbOOErBkO2Mo73W566YYIXoiSH m/YytpPUNqrioZLgnObB35537mSONQt0iFBtFx3MpdW2p1WFnjRnrsQsalPTSFg8vW0b ltU0UimKozUk4lPK7HbEodPWryOOqN7D8ngX2jeEZqCJv0d2BqqcAaB2vYSMGCGj1oUj GupqySw3Q4YZTc5/uoNjrKU8sPpn27RSvFnMw8y0sQ1bJ2puEhvBzHECohZtSPI0lA8i q+Eg== X-Gm-Message-State: APjAAAUPJL+FEdgweOC8shcv2DrZ/iyVsAI8NpfzeiE0DnTrcJD470qu kENw1QtbnVGCIRdxVifY8LLeEn5fey4d7A== X-Google-Smtp-Source: APXvYqxg+3KllbK4kA5ypjcKBsoQYV5QaTtW685X8LWTvY+625q4n9SmvCnwuzuONZeXYslyqYfnlg== X-Received: by 2002:ac8:5513:: with SMTP id j19mr4695192qtq.143.1581026407673; Thu, 06 Feb 2020 14:00:07 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([179.56.50.157]) by smtp.gmail.com with ESMTPSA id x6sm321474qkh.20.2020.02.06.14.00.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2020 14:00:07 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 24BA6300807; Thu, 6 Feb 2020 19:00:05 -0300 (-03) Date: Thu, 6 Feb 2020 19:00:05 -0300 From: Alvaro Herrera To: Jehan-Guillaume de Rorthais Cc: pgsql-bugs@lists.postgresql.org Subject: Re: FK violation in partitioned table after truncating a referenced partition Message-ID: <20200206220005.GA31399@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200206211238.GA29108@alvherre.pgsql> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Also, I think we should patch the documentation like this, because this effect is not 100% obvious. (For example, if the partition strategy is identical in both referenced and referencing tables, you would wish that only the equivalent partition is truncated. However, I doubt this can be really implemented.) I do wonder how do other RDBMSs behave. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services