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 1gmfzj-0005fB-HI for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Jan 2019 14:28:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gmfzi-00014B-1r for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Jan 2019 14:28:38 +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 1gmfzh-00013s-Md for pgsql-hackers@lists.postgresql.org; Thu, 24 Jan 2019 14:28:37 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gmfze-0006qc-SI for pgsql-hackers@lists.postgresql.org; Thu, 24 Jan 2019 14:28:37 +0000 Received: by mail-qk1-x741.google.com with SMTP id 189so3303233qkj.8 for ; Thu, 24 Jan 2019 06:28:34 -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=Kgb+DHcmP27NPzpB3jeMNhoD3ydEN5G4nHc9bb4zMYA=; b=XdyBZJOLg55Xe5AU/MHw68897N4OKM9IZ3Xn9T4oic1hqXTSqCPrt0eR8D4W7IvCjO jrqNpZR1QfR1+ltmGbOMtGrqJlIWojzcBCcvGM8aNyFXVH92AjQMlPsyfPyWNkFHBQmg jo6yb7xENJH6qQb+ueiXcryHJldTd9HMXvik2/QpSMqiPMx7ruzYI4rH+Y0jeuc2JAXc uHL3cnmBcYe1Pesmax3YvWVA09WroC0AWzPL6xCoOTZIPt6HMuSg6PGiKSFMpS7nGYXs Wzapf2NzUXxpaaG1cDGGN8+97sE2+jIbywGm3I9ulRNO6gFbLmUjNUb9TUmF6qk6nMdQ MT4w== 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=Kgb+DHcmP27NPzpB3jeMNhoD3ydEN5G4nHc9bb4zMYA=; b=QIVnAQvhrGtP9w9PzFxqf8P7Im4dB/Dr/MWOBZem/0Ncb4iauS+phHS8At4Lfhu9th 7YN1YyxZmcQtroFePYqn5LIdtIGCcXW77GfH8pWnX2ZYjBpzRinppFlA0X7/GmrOaHzF KUFGyaxfRHmKR/P6kOcaLPenQS8UY7xPiHasO3IWkhHDRB+LKbGtUfJVRhfquPUpa5oH Qzlza4k2qe+e0x4agBc9MKBKEGX5EuBEK017AW+FAmdco63/EQhadXVc6mQZJa9yHDqy csOdeXfSNGvUGjbgJzlZz3W/ha3Pkdsa6NTNbEXna+Z7/crLGhClzGnnb0BrfVUyIczO D/xg== X-Gm-Message-State: AJcUukcb+R7IlNTu7GIL907EvaWwUnBuJZJ9P/1P/oNP7bz0+Nv2h/6i 8YLvrn77FhxL7VmL3sxjhbnSXg== X-Google-Smtp-Source: ALg8bN7SJ61bQIpBEwdkdOYEW5UYQRf5pGy9mkVMfbzhnJ/A4M7T3mI31II3tmfvAGVTYi4GnX603g== X-Received: by 2002:a37:358d:: with SMTP id c135mr5682538qka.232.1548340112984; Thu, 24 Jan 2019 06:28:32 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id n3sm76030904qtc.81.2019.01.24.06.28.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Jan 2019 06:28:32 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id B0F2DAB4; Thu, 24 Jan 2019 11:28:30 -0300 (-03) Date: Thu, 24 Jan 2019 11:28:30 -0300 From: Alvaro Herrera To: Amit Langote Cc: Tom Lane , pgsql-committers@lists.postgresql.org, Pg Hackers Subject: Re: pgsql: Detach constraints when partitions are detached Message-ID: <201901241428.qggskqa5qwi2@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716-1013-2c1e88 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk CC'ing -hackers. On 2019-Jan-24, Amit Langote wrote: > On 2019/01/24 13:58, Tom Lane wrote: > > Alvaro Herrera writes: > >> Detach constraints when partitions are detached > > > > Hm ... it looks like this fails under -DRELCACHE_FORCE_RELEASE: > > Oops, sorry. This is why: > > index_close(idx, NoLock); > ... > + if (!idx->rd_index->indisprimary && !idx->rd_index->indisunique) > + continue; > > Attached a fix. Mumble. I changed course here and went for simpler coding instead. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services