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 1rPmaW-00E6ib-DR for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jan 2024 16:46:56 +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 1rPmaS-005ALo-9N for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jan 2024 16:46:52 +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 1rPmaS-005ALa-0B for pgsql-hackers@lists.postgresql.org; Tue, 16 Jan 2024 16:46:52 +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 1rPmaP-00299d-BU for pgsql-hackers@lists.postgresql.org; Tue, 16 Jan 2024 16:46:51 +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 40GGkjnx1737415; Tue, 16 Jan 2024 11:46:45 -0500 From: Tom Lane To: Robert Haas cc: pgsql-hackers@lists.postgresql.org Subject: Re: ALTER TYPE OWNER fails to recurse to multirange In-reply-to: References: <1580383.1705343264@sss.pgh.pa.us> <1587577.1705346911@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Mon, 15 Jan 2024 15:01:25 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1737413.1705423605.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 16 Jan 2024 11:46:45 -0500 Message-ID: <1737414.1705423605@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > On Mon, Jan 15, 2024 at 2:28 PM Tom Lane wrote: >> I'm reasoning by analogy to array types, which are automatically >> created and automatically updated to keep the same ownership >> etc. properties as their base type. To the extent that multirange >> types don't act exactly like that, I say it's a bug/oversight in the >> multirange patch. So I think this is a backend bug, not a pg_dump >> bug. > Well, I guess maybe I'm just clueless. I thought that the range and > multirange were two essentially independent objects being created by > the same command. But I haven't studied the implementation so maybe > I'm completely wrong. They're by no means independent. What would it mean to have a multirange without the underlying range type? Also, we already treat the multirange as dependent for some things: d=# create type varbitrange as range (subtype = varbit); CREATE TYPE d=# \dT List of data types Schema | Name | Description --------+------------------+------------- public | varbitmultirange | public | varbitrange | (2 rows) d=# drop type varbitmultirange; ERROR: cannot drop type varbitmultirange because type varbitrange requires it HINT: You can drop type varbitrange instead. d=# drop type varbitrange restrict; DROP TYPE d=# \dT List of data types Schema | Name | Description --------+------+------------- (0 rows) So I think we're looking at a half-baked dependency design, not two independent objects. regards, tom lane