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 1t78KN-000BW8-M9 for pgsql-general@arkaria.postgresql.org; Sat, 02 Nov 2024 07:13:43 +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 1t78KK-0041Ul-RH for pgsql-general@arkaria.postgresql.org; Sat, 02 Nov 2024 07:13:41 +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 1t78KK-0041Qz-G4 for pgsql-general@lists.postgresql.org; Sat, 02 Nov 2024 07:13:40 +0000 Received: from sm-r-016-dus.org-dns.com ([89.107.70.6]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t78KI-004JXE-0f for pgsql-general@lists.postgresql.org; Sat, 02 Nov 2024 07:13:40 +0000 Received: from smarthost-dus.org-dns.com (localhost [127.0.0.1]) by smarthost-dus.org-dns.com (Postfix) with ESMTP id 004F1A0A64 for ; Sat, 2 Nov 2024 08:13:37 +0100 (CET) Received: by smarthost-dus.org-dns.com (Postfix, from userid 1001) id E8540A0874; Sat, 2 Nov 2024 08:13:36 +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 987E5A20EC for ; Sat, 2 Nov 2024 08:13:36 +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: Sat, 2 Nov 2024 08:13:34 +0100 (GMT+01:00) From: Thiemo Kellner To: "pgsql-generallists.postgresql.org" Message-ID: <97798840-f7e0-4d6d-8326-1c2043e9cde9@gelassene-pferde.biz> In-Reply-To: <5466153d-3bc3-4553-a5b2-d4c5050fb1d5@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> <8791c3bf-6fff-4db4-a29e-2679d2de0960@gelassene-pferde.biz> <20241102001013.Horde.g70bTplHNWnh_M3vk9I-edj@webmail.gelassene-pferde.biz> <5466153d-3bc3-4553-a5b2-d4c5050fb1d5@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: <97798840-f7e0-4d6d-8326-1c2043e9cde9@gelassene-pferde.biz> X-PPP-Message-ID: <173053161645.367278.9447622539479082592@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 My bad. I was expecting primary and unique to be mentioned here, so I did n= ot read on. **INCLUDING CONSTRAINTS*** **#[https://www.postgresql.org/docs/current/sql-= createtable.html#SQL-CREATETABLE-PARMS-LIKE-OPT-CONSTRAINTS]* /*CHECK*// constraints will be copied. No distinction is made between colum= n constraints and table constraints. Not-null constraints are always copied= to the new table./ 02.11.2024 00:53:53 Adrian Klaver : > On 11/1/24 16:10, thiemo@gelassene-pferde.biz wrote: >> Adrian Klaver escribi=C3=B3: >> On 11/1/24 13:47, Thiemo Kellner wrote: >>>> It looks to me basically to be a "create table A as select * from B wh= ere false". >>>=20 >>> No it more capable then that. >> Yes, I wrote basically, not exactly. >> CREATE TABLE LIKE has=C2=A0 like_option whic= h allows to transfer over more attributes of the table, for example default= s, constraints, indexes, etc. >> But, to my understanding, no primary nor unique nor foreign constraint. >>=20 >=20 >=20 > "INCLUDING INDEXES >=20 > =C2=A0=C2=A0=C2=A0=C2=A0 Indexes, PRIMARY KEY, UNIQUE, and EXCLUDE constr= aints on the original table will be created on the new table. Names for the= new indexes and constraints are chosen according to the default rules, reg= ardless of how the originals were named. (This behavior avoids possible dup= licate-name failures for the new indexes.) > " >=20 > FK's are not in the the INCLUDINGs, nor triggers. >=20 >=20 > --=20 > Adrian Klaver > adrian.klaver@aklaver.com