Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYk52-0001Dn-6g for pgsql-admin@arkaria.postgresql.org; Thu, 15 Sep 2022 08:18:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oYk51-00023z-1B for pgsql-admin@arkaria.postgresql.org; Thu, 15 Sep 2022 08:18:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYk50-00023R-Hf for pgsql-admin@lists.postgresql.org; Thu, 15 Sep 2022 08:18:38 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oYk4y-0000O3-1V for pgsql-admin@lists.postgresql.org; Thu, 15 Sep 2022 08:18:38 +0000 Received: by mail-ej1-x636.google.com with SMTP id bj12so40253241ejb.13 for ; Thu, 15 Sep 2022 01:18:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date; bh=1DG09LQj1wn8c58jwNKHVgqnYic57UOTsQsZN4ImIkw=; b=meJIxrBXGozu/K9VJ8xW43qvHR7ZxcVNz42zH15pvkKlFXBf2X+LsdcFkZaFgqCkvn ggcSEk9FzO7K8R0U+mhaHhaoC89tCwdWVqBWbBwUZZbC/HqXvZwWN27w6G8WyWINSpHv vmxlyzjP+XsFG753aI10+zcIK18f3Kmw3V4FkGLhX2fwSeEUFOspoCf2u3S7CsmcfwCw O8OXD3q7pwdJGatlfgcuYwFmDRgO11lO19xbHxVpm0HbxYMN2Wl6Qbl1TevV2iQbQP3k CkxE3N9SikgINOSYC1ixzZ0+PuNW0v6DGzwR5NpwKAz2VJ9/TqfsjKJ0alZBFyDb2qh6 j0vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date; bh=1DG09LQj1wn8c58jwNKHVgqnYic57UOTsQsZN4ImIkw=; b=hRMd9GL3K5rFMklrKStYYTS2bkqehnvV0SYO/YioaHonCYLmEsFhoK4SILU0/DCr2p mNVG5PUJOhlzSo5Bm4cCS86Hb11qDg/Z3kS+PABQnjw5m52i/kYaetVH5DOfLtyZq5EA h2AO7Ye3tol7AEwrBWuZiU7HNg3Gf/YyonMLAyIx7HnCYtjAoxMxMG9u1yStqML2gDVG 0b69HNHMca+MSZcAmK1ua7pqsyPCycpRi9Hn9HRn0qD91RdD8gxmeCqv7x5aG2fOyZ9j 1GvntqLrKmKmwMl7+ig+RFcie/kNbUE68dorHFQQlUPTh+/GlNxR87FNe0b/jIevDomr XrJg== X-Gm-Message-State: ACgBeo2otH43Oyv9xmT8GnndB+4NBLZdCr718589j1H/x6E4WTN/0z9d a0uocx9RtjRWqGRGzJjYmKeXRPlOOIQTiQ== X-Google-Smtp-Source: AA6agR6DdVLJeSCKK/fn5raM6DnpzNBOJBjIxrApp+wckyt+HJQl00ArDR6KZstpQ7xhMYwhVY0ZtQ== X-Received: by 2002:a17:906:a0d3:b0:73d:be5b:2b52 with SMTP id bh19-20020a170906a0d300b0073dbe5b2b52mr29021040ejb.727.1663229915047; Thu, 15 Sep 2022 01:18:35 -0700 (PDT) Received: from localhost.localdomain (62-46-255-42.adsl.highway.telekom.at. [62.46.255.42]) by smtp.gmail.com with ESMTPSA id z20-20020a170906715400b0073d65a95161sm8676941ejj.222.2022.09.15.01.18.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Sep 2022 01:18:34 -0700 (PDT) Message-ID: <5de6ad47c3a59ea83e267707771823f03e271e1d.camel@cybertec.at> Subject: Re: Local parent table and Foreign table(s) as partition(s), is it possible? From: Laurenz Albe To: Sbob , Pgsql-admin Date: Thu, 15 Sep 2022 10:18:33 +0200 In-Reply-To: <7e2b6998-d62c-0460-066d-dce9f238e5af@quadratum-braccas.com> References: <25206e71-b388-3c51-ce17-5fd0912398eb@quadratum-braccas.com> <7e2b6998-d62c-0460-066d-dce9f238e5af@quadratum-braccas.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2022-09-14 at 12:17 -0600, Sbob wrote: > > On 9/14/22 12:01, Laurenz Albe wrote: > > On Wed, 2022-09-14 at 11:41 -0600, Sbob wrote: > > > I see the below options in the CREATE FOREIGN TABLE, however I assume these would both connect > > > to a master/parent table on the foreign server. Is it possible to have a Foreign Table that > > > acts as a partition of a local parent table, via either method (INHERITS or PARTITION OF)? > > Yes, exactly: a foreign table can be a partition of a local partitioned table. > > This can be used to implement sharding, if the foreign data wrapper supports the "parallel append" > > node introduced in PostgreSQL v14. > > Nice!  so do I simply use the INHERITS clause or the PARTITION OF clause > when I create the foreign table and reference the local parent table? Precisely. Use declarative partitioning rather than inheritance. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com