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 1t4PLL-000NMB-86 for pgsql-general@arkaria.postgresql.org; Fri, 25 Oct 2024 18:47:27 +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 1t4PLJ-002ZZL-IX for pgsql-general@arkaria.postgresql.org; Fri, 25 Oct 2024 18:47:25 +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 1t4PLJ-002ZZC-7Z for pgsql-general@lists.postgresql.org; Fri, 25 Oct 2024 18:47:25 +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 1t4PLH-002xTt-0C for pgsql-general@lists.postgresql.org; Fri, 25 Oct 2024 18:47:25 +0000 Received: from smarthost-dus.org-dns.com (localhost [127.0.0.1]) by smarthost-dus.org-dns.com (Postfix) with ESMTP id 35FB1A0303 for ; Fri, 25 Oct 2024 20:47:22 +0200 (CEST) Received: by smarthost-dus.org-dns.com (Postfix, from userid 1001) id 29B73A0AC9; Fri, 25 Oct 2024 20:47:22 +0200 (CEST) X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE, 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 BDEA6A0303 for ; Fri, 25 Oct 2024 20:47:21 +0200 (CEST) Authentication-Results: ha01s018.org-dns.com; spf=pass (sender IP is 5.83.191.131) smtp.mailfrom=thiemo@gelassene-pferde.biz smtp.helo=[192.168.178.48] Received-SPF: pass (ha01s018.org-dns.com: connection is authenticated) Content-Type: multipart/alternative; boundary="------------eybuGgrjGGHEZCPBYWvwIFWM" Message-ID: <5757acdc-39ed-4642-a449-26e47b1bcf95@gelassene-pferde.biz> Date: Fri, 25 Oct 2024 20:47:11 +0200 MIME-Version: 1.0 From: Thiemo Kellner Subject: Plans for partitioning of inheriting tables References: To: PostgreSQL General In-Reply-To: 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 This is a multi-part message in MIME format. --------------eybuGgrjGGHEZCPBYWvwIFWM Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Am 25.10.2024 um 17:57 schrieb Adrian Klaver: > >> I do not feel it applies to my case. I tried to create a partitioned >> table that inherits columns from a base table. The documentation you >> provided the URL seems to speak of realising partitioning by using >> inheritance. > > This needs a code example to go any further. Sorry, my bad. I posted the URL of the table that is inherited from. The recepient is https://sourceforge.net/p/treintaytres/code/HEAD/tree/trunk/code_files/data_storage/PostgreSQL/tables/TOPO_FILES.pg_sqlcreate table if not exists TOPO_FILES ( SOURCE_ID uuid constraint TOPO_FILES␟FK_01 references SOURCES (ID) match full not null ,FILE_NAME text not null ,TILE raster not null ,FILE_CREATION_PIT timestamp(6) with time zone not null ,FILE_HASH text not null ,constraint TOPO_FILES␟PK primary key (ID) ,constraint TOPO_FILES␟UQ unique (SOURCE_ID ,FILE_NAME) ) inherits(TEMPLATE_TECH); -- partition by hash (source_id); --NOTE Up to PG 17, partitioning with inheriting table is not possible. The spender table ishttps://sourceforge.net/p/treintaytres/code/HEAD/tree/trunk/code_files/data_storage/PostgreSQL/tables/TEMPLATE_TECH.pg_sql create table if not exists TEMPLATE_TECH ( ID uuid constraint TEMPLATE_TECH␟PK primary key not null default gen_random_uuid() ,ENTRY_PIT timestamp(6) with time zone not null default clock_timestamp() ); --------------eybuGgrjGGHEZCPBYWvwIFWM Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Am 25.10.2024 um 17:57 schrieb Adrian Klaver:

I do not feel it applies to my case. I tried to create a partitioned table that inherits columns from a base table. The documentation you provided the URL seems to speak of realising partitioning by using inheritance.

This needs a code example to go any further.

Sorry, my bad. I posted the URL of the table that is inherited from. The recepient is https://sourceforge.net/p/treintaytres/code/HEAD/tree/trunk/code_files/data_storage/PostgreSQL/tables/TOPO_FILES.pg_sqlcreate table if not exists TOPO_FILES (

     SOURCE_ID          uuid
        constraint TOPO_FILES␟FK_01
            references SOURCES (ID)
            match full
        not null
    ,FILE_NAME          text
        not null
    ,TILE               raster
        not null
    ,FILE_CREATION_PIT  timestamp(6) with time zone
        not null
    ,FILE_HASH          text
        not null
    ,constraint TOPO_FILES␟PK primary key (ID)
    ,constraint TOPO_FILES␟UQ unique (SOURCE_ID
                                     ,FILE_NAME)
)
inherits(TEMPLATE_TECH);
-- partition by hash (source_id); --NOTE Up to PG 17, partitioning with inheriting table is not possible.


The spender table is https://sourceforge.net/p/treintaytres/code/HEAD/tree/trunk/code_files/data_storage/PostgreSQL/tables/TEMPLATE_TECH.pg_sql

create table if not exists TEMPLATE_TECH (
     ID                 uuid
        constraint TEMPLATE_TECH␟PK primary key
        not null
        default gen_random_uuid()
    ,ENTRY_PIT          timestamp(6) with time zone
        not null
        default clock_timestamp()
);


--------------eybuGgrjGGHEZCPBYWvwIFWM--