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 1hgENX-0004mT-Sm for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Jun 2019 20:18:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hgENW-0000y9-Nc for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Jun 2019 20:18:50 +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 1hgENW-0000y2-82 for pgsql-bugs@lists.postgresql.org; Wed, 26 Jun 2019 20:18:50 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hgENT-0005Dq-9n for pgsql-bugs@lists.postgresql.org; Wed, 26 Jun 2019 20:18:49 +0000 Received: by mail-qk1-x743.google.com with SMTP id m14so2783074qka.10 for ; Wed, 26 Jun 2019 13:18:47 -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=KQIGowrFNWSym0o2ZwXNbTSxkfzJZyrCLVHCu/5Unkk=; b=1vkv5VSVMkmkG7vboJ+/zcBZ5h/aoHKnZW4nQZSWSF31vU+1lFlp2pVA+ElSaZIgNX zx/Be/L0BqK8jZm6pfGc0A7DUY/B6mkSp/Rzbl2Xbje3fgTmHUvkI3ZV6+c0WkXMHrCy xBG4yOrzvBIfC5eHqh3MRo6ljj52mkYgA9+fOeWm9ZHWIich0KORkYlbX/2u2Mo/NpAf h6z4en8NXF8QGaE6VpQGMp3eECGCMyKKzrFFgZqLqSoOAssws74FobESeuyyzSKd4rYb 6C34DdOabXSXIku6DBozX7j7DN52fug2kFH6p4cUQWkGXRqWXsCdkXNy3iSlwD2sr6AG Okpg== 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=KQIGowrFNWSym0o2ZwXNbTSxkfzJZyrCLVHCu/5Unkk=; b=fD7q6SwPbvViH4YEGKV6p5c1hqc1hRRSoT9Nku/ujJ/3S8MREXdE5p2b7uT7Nq8dsa nMkJweoWH8JF0C2/NjnSkK2cOnKCeGl4ZRd8W2+ZLXA3iC4n4DxwLPB8ce6tjSiSjotR aJ9p/iXBAdhWOXESFl2kIi89wTen49zfWLYmsXn/mazWuYNIQ9XfeLNUIVq0qxKiiMpq N1a1SzQKOdl/QXFJtjtID/D2gfT3nMT8NDVIx0T5zcr76VeZ8cwUVJV914iZEa88OSJ+ pLvhd6bZyKsQqwcbvu0FN3K0ahNz9EJQRmj4H3ndSngv+IM/hOCfay/ECLYsv2sTh0vv /MzQ== X-Gm-Message-State: APjAAAU8ut4VyDm5nfsHWY6Lyc1LRkyd0MC84PkwzAE/BUzRLVXoAHTm HHsB3cOTySjSYrO6EdupL3h7Bg== X-Google-Smtp-Source: APXvYqwQsDnDUe1+Xbx/Pdt8fgolNTDOwIbmdyHzec2F/Uv/a42kJqcVbGopf8gMij5unwIBf5F0fQ== X-Received: by 2002:a05:620a:13bc:: with SMTP id m28mr5498315qki.334.1561580325916; Wed, 26 Jun 2019 13:18:45 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id w16sm12363037qtc.41.2019.06.26.13.18.45 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 13:18:45 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 910F71206EA; Wed, 26 Jun 2019 16:18:43 -0400 (-04) Date: Wed, 26 Jun 2019 16:18:43 -0400 From: Alvaro Herrera To: Amit Langote Cc: Pavan Deolasee , stepya@ukr.net, PostgreSQL mailing lists Subject: Re: BUG #15724: Can't create foreign table as partition Message-ID: <20190626201843.GA18542@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: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jun-26, Amit Langote wrote: > On Tue, Jun 25, 2019 at 9:57 PM Alvaro Herrera wrote: > > Because if you do that, you might build a few indexes on regular > > partitions before coming across a foreign one, which is very unfriendly. > > I'll add a comment to this effect. > > Hmm, why would other partitions be involved? > AttachPartitionEnsureIndexes() only considers the partition being > attached, like DefineRelation only considers the partition being > created. Sorry, I meant other *indexes*. You might build a few regular (non-unique) indexes before coming across a unique index, at which point you throw the error. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services