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 1rb2ss-00Cmvk-44 for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Feb 2024 18:24:26 +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 1rb2sp-003PQk-6D for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Feb 2024 18:24:23 +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 1rb2so-003PQc-T7 for pgsql-hackers@lists.postgresql.org; Fri, 16 Feb 2024 18:24:22 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rb2sm-007Xu3-Bx for pgsql-hackers@postgresql.org; Fri, 16 Feb 2024 18:24:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 41GIOGkS3462359; Fri, 16 Feb 2024 13:24:16 -0500 From: Tom Lane To: Peter Eisentraut cc: Ashutosh Bapat , pgsql-hackers Subject: Re: table inheritance versus column compression and storage settings In-reply-to: <3426460.1708095481@sss.pgh.pa.us> References: <24656cec-d6ef-4d15-8b5b-e8dfc9c833a7@eisentraut.org> <38546838-8a60-4d50-ba8e-b2c7cf2cb64b@eisentraut.org> <3426460.1708095481@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 16 Feb 2024 09:58:01 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3462357.1708107856.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 16 Feb 2024 13:24:16 -0500 Message-ID: <3462358.1708107856@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > I find it surprising that the committed patch does not touch > pg_dump. Is it really true that pg_dump dumps situations with > differing compression/storage settings accurately already? It's worse than I thought. Run "make installcheck" with today's HEAD, then: $ pg_dump -Fc regression >r.dump $ createdb r2 $ pg_restore -d r2 r.dump = pg_restore: error: could not execute query: ERROR: column "a" inherits co= nflicting storage methods HINT: To resolve the conflict, specify a storage method explicitly. Command was: CREATE TABLE public.stchild4 ( a text ) INHERITS (public.stparent1, public.stparent2); ALTER TABLE ONLY public.stchild4 ALTER COLUMN a SET STORAGE MAIN; pg_restore: error: could not execute query: ERROR: relation "public.stchi= ld4" does not exist Command was: ALTER TABLE public.stchild4 OWNER TO postgres; pg_restore: error: could not execute query: ERROR: relation "public.stchi= ld4" does not exist Command was: COPY public.stchild4 (a) FROM stdin; pg_restore: warning: errors ignored on restore: 3 What I'd intended to compare was the results of the query added to the regression tests: regression=3D# SELECT attrelid::regclass, attname, attstorage FROM pg_attr= ibute WHERE (attrelid::regclass::name like 'stparent%' OR attrelid::regclass::name like 'stchild%') and attname =3D 'a' ORDER BY 1, 2; attrelid | attname | attstorage = -----------+---------+------------ stparent1 | a | p stparent2 | a | x stchild1 | a | p stchild3 | a | m stchild4 | a | m stchild5 | a | x stchild6 | a | m (7 rows) r2=3D# SELECT attrelid::regclass, attname, attstorage FROM pg_attribute WHERE (attrelid::regclass::name like 'stparent%' OR attrelid::regclass::name like 'stchild%') and attname =3D 'a' ORDER BY 1, 2; attrelid | attname | attstorage = -----------+---------+------------ stparent1 | a | p stchild1 | a | p stchild3 | a | m stparent2 | a | x stchild5 | a | p stchild6 | a | m (6 rows) So not only does stchild4 fail to restore altogether, but stchild5 ends with the wrong attstorage. This patch definitely needs more work. regards, tom lane