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 1uKHgQ-000S7w-Bb for pgsql-general@arkaria.postgresql.org; Wed, 28 May 2025 14:23:06 +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 1uKHgN-000QpQ-UZ for pgsql-general@arkaria.postgresql.org; Wed, 28 May 2025 14:23:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uKHea-000Mva-W3 for pgsql-general@lists.postgresql.org; Wed, 28 May 2025 14:21:12 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uKHeW-000O8W-0A for pgsql-general@lists.postgresql.org; Wed, 28 May 2025 14:21:12 +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 54SEL1JY1452428; Wed, 28 May 2025 10:21:01 -0400 From: Tom Lane To: Richard Zetterberg cc: Adrian Klaver , pgsql-general@lists.postgresql.org Subject: Re: Changing a varchar(7) domain into text directly in pg_type In-reply-to: References: <4c1c0192-e4f1-4e13-8dae-bfd9bb1801c1@aklaver.com> Comments: In-reply-to Richard Zetterberg message dated "Wed, 28 May 2025 11:53:51 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1452426.1748442061.1@sss.pgh.pa.us> Date: Wed, 28 May 2025 10:21:01 -0400 Message-ID: <1452427.1748442061@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Zetterberg writes: > In my head, this change would be instant and postgres would carry on like > nothing happened and that the domain always had the type `text`. Is this a > fools errand? Or could it actually make sense in this situation? Yeah, I think you can probably get away with this (especially since you've already tested the effects in a throwaway database, IIUC). The main thing people tend to forget when doing this sort of manual catalog surgery is updating pg_depend and/or pg_shdepend. But here there's nothing to do. Since both varchar and text are undroppable built-in types, we don't bother to make dependencies on them. And you're not changing the domain's schema or owner, so its other dependencies don't need to change. regards, tom lane