Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6xTO-00GfES-3G for pgsql-general@arkaria.postgresql.org; Fri, 01 Nov 2024 19:38:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t6xTM-00Gy8F-6Y for pgsql-general@arkaria.postgresql.org; Fri, 01 Nov 2024 19:38:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6xTL-00Gy5N-6g for pgsql-general@lists.postgresql.org; Fri, 01 Nov 2024 19:38:16 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6xTI-0040n8-7Q for pgsql-general@lists.postgresql.org; Fri, 01 Nov 2024 19:38:14 +0000 Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id D016D1140083; Fri, 1 Nov 2024 15:38:10 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Fri, 01 Nov 2024 15:38:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1730489890; x=1730576290; bh=pggFRZ0AbQupy1PE3dRHU5ytgK2wXb9GwFAatBJHutc=; b= lpuJcDYCEi0iA4tfcElesqKTBcC/+QEY6L2BIL9v1B6bykLta0mKn80eIfXJ+sf0 cc4O3QbxCKFeIz2F8bJ2s0/KdSmdERW2Zv2+I2KtSqojSW0yZPI1Jc4iqEqkndl2 pLeXVM9GUkCapn0dLnI0Q9JqTJxZrOeGaKKFtnre2f/MVSmfUJ8B+sM2v5Do4cLL 5dfO0HqvSw72oWb4hoiF0A5mSysXiNVlBbMP9RqNQ2ttbFwUpB3qKqHQyjDBJq6c Xq3yq759YziVKE03vxVWEaR+L56PzuGoC29hqHFK+3rqtoop/pnclSG8OHhjRkpY 7F4QVpTpHYr+WwwptI615w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1730489890; x=1730576290; bh=p ggFRZ0AbQupy1PE3dRHU5ytgK2wXb9GwFAatBJHutc=; b=MvUzcFCQehPfsT4b9 vj0XVDSap1YYtpDD7poRIY/F+p895n7oYt6XVV0Kqxr+OwtgFP/dZ0u/x/JmJvQA Uz9zZObcJ05W9dONG0U7cN8eOy/NLCxBtqQgrXQ7dXXLs1gK9JPov0JJNglTO7UX 4Z3hOU4blBVBEWw6+nbQn4/t6v0yVQcr+QWbcFwsnj4/8sFOWqSmalwz/N3lHPLy n4Mfm8P8gRSXRvdHFyr8uT25UuqsO/cQPjW/SyXHH0FA9uxI0B1nficJgJk2imza HJX5/jpDadPzeilA19G2mG4QyfJXqbhvQB/KV1yr1xgk+haQl2Qyo2w4cTD2VIA0 9OXIQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdekledguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtvdej necuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrh esrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepleegveekkeekueeigfdt veeileeuhfefudefteekjeffkeejueejheegheegkedtnecuffhomhgrihhnpehpohhsth hgrhgvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsg gprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehthhhivghm ohesghgvlhgrshhsvghnvgdqphhfvghruggvrdgsihiipdhrtghpthhtohepphhgshhqlh dqghgvnhgvrhgrlheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Nov 2024 15:38:09 -0400 (EDT) Message-ID: <666c82fe-be27-4f32-99ad-8952a56f2282@aklaver.com> Date: Fri, 1 Nov 2024 12:38:09 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Plans for partitioning of inheriting tables To: thiemo@gelassene-pferde.biz, PostgreSQL General References: <5757acdc-39ed-4642-a449-26e47b1bcf95@gelassene-pferde.biz> <20241101094106.Horde.TwPSs9YUgJ5v-_M-4ltwoeh@webmail.gelassene-pferde.biz> <14c1eb8c-a853-43b3-a1ea-b105bfd6c99b@aklaver.com> <20241101182110.Horde.P_w6KptTjJNeM1X9Asg5bE3@webmail.gelassene-pferde.biz> <6bc57377-52e1-496a-b9d6-4cd9dc84d92e@aklaver.com> <20241101201600.Horde.Br4fPP8BFAAwzFoMaM8_eJS@webmail.gelassene-pferde.biz> Content-Language: en-US From: Adrian Klaver In-Reply-To: <20241101201600.Horde.Br4fPP8BFAAwzFoMaM8_eJS@webmail.gelassene-pferde.biz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/1/24 12:16, thiemo@gelassene-pferde.biz wrote: > Thanks, I shall have a look into it. I was under the assumption the the > create table like would create no more than a structural copy. Not sure what you mean by structural copy, but the table created by CREATE TABLE LIKE will not have any association with the table it was created from. https://www.postgresql.org/docs/current/sql-createtable.html "Unlike INHERITS, the new table and original table are completely decoupled after creation is complete. Changes to the original table will not be applied to the new table, and it is not possible to include data of the new table in scans of the original table." > > Torsten Förtsch > > escribió: > >> Thiemo, >> it looks to me like you are using inheritance just to make sure your >> SOURCES and TOPO_FILES tables have some common columns. If you are not >> actually querying the TEMPLATE_TECH table and expect to see all the >> rows from the other 2 tables in that one table combined, then you >> could use CREATE TABLE (LIKE ...) instead of inheritance. That way >> your "child" tables would become normal tables and you could use >> declarative partitioning on them. >> Even if you are querying the TEMPLATE_TECH table, you could still do >> that by turning the TEMPLATE_TECH table into a view which performs a >> UNION ALL over the other tables. > > -- Adrian Klaver adrian.klaver@aklaver.com