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 1t6yYi-00Glpn-Jm for pgsql-general@arkaria.postgresql.org; Fri, 01 Nov 2024 20:47:52 +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 1t6yYg-00HTF9-KM for pgsql-general@arkaria.postgresql.org; Fri, 01 Nov 2024 20:47:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6yYg-00HTF1-97 for pgsql-general@lists.postgresql.org; Fri, 01 Nov 2024 20:47:50 +0000 Received: from sm-r-008-dus.org-dns.com ([84.19.1.236]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6yYZ-004FMF-VS for pgsql-general@lists.postgresql.org; Fri, 01 Nov 2024 20:47:49 +0000 Received: from smarthost-dus.org-dns.com (localhost [127.0.0.1]) by smarthost-dus.org-dns.com (Postfix) with ESMTP id 2B1E9A221A for ; Fri, 1 Nov 2024 21:47:40 +0100 (CET) Received: by smarthost-dus.org-dns.com (Postfix, from userid 1001) id 1E50CA21F3; Fri, 1 Nov 2024 21:47:40 +0100 (CET) X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_INFOUSMEBIZ, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 Received: from ha01s018.org-dns.com (ha01s018.org-dns.com [62.108.32.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smarthost-dus.org-dns.com (Postfix) with ESMTPS id C6F32A221A for ; Fri, 1 Nov 2024 21:47:39 +0100 (CET) Authentication-Results: ha01s018.org-dns.com; spf=pass (sender IP is 5.83.191.177) smtp.mailfrom=thiemo@gelassene-pferde.biz smtp.helo=dummy.faircode.eu Received-SPF: pass (ha01s018.org-dns.com: connection is authenticated) Date: Fri, 1 Nov 2024 21:47:37 +0100 (GMT+01:00) From: Thiemo Kellner To: PostgreSQL General Message-ID: <8791c3bf-6fff-4db4-a29e-2679d2de0960@gelassene-pferde.biz> In-Reply-To: <666c82fe-be27-4f32-99ad-8952a56f2282@aklaver.com> 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> <666c82fe-be27-4f32-99ad-8952a56f2282@aklaver.com> Subject: Re: Plans for partitioning of inheriting tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: <8791c3bf-6fff-4db4-a29e-2679d2de0960@gelassene-pferde.biz> X-PPP-Message-ID: <173049405969.3854184.15497698228812447019@ha01s018.org-dns.com> X-PPP-Vhost: gelassene-pferde.biz X-POWERED-BY: wint.global - AV:CLEAN SPAM:OK List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk It looks to me basically to be a "create table A as select * from B where f= alse". 01.11.2024 20:38:15 Adrian Klaver : > 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. >=20 > Not sure what you mean by structural copy, but the table created by CREAT= E TABLE LIKE will not have any association with the table it was created fr= om. >=20 > https://www.postgresql.org/docs/current/sql-createtable.html >=20 > "Unlike INHERITS, the new table and original table are completely decoupl= ed after creation is complete. Changes to the original table will not be ap= plied to the new table, and it is not possible to include data of the new t= able in scans of the original table." >=20 >> Torsten F=C3=B6rtsch > escribi=C3=B3: >> Thiemo, >>> it looks to me like you are using inheritance just to make sure your SO= URCES and TOPO_FILES tables have some common columns. If you are not actual= ly 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 beco= me normal tables and you could use declarative partitioning on them. >>> Even if you are querying the TEMPLATE_TECH table, you could still do th= at by turning the TEMPLATE_TECH table into a view which performs a UNION AL= L over the other tables. >>=20 >=20 > --=20 > Adrian Klaver > adrian.klaver@aklaver.com