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 1sg1qc-00Eee9-AI for pgsql-general@arkaria.postgresql.org; Mon, 19 Aug 2024 12:50:58 +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 1sg1qa-002joA-4Q for pgsql-general@arkaria.postgresql.org; Mon, 19 Aug 2024 12:50:56 +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 1sg1qZ-002jnp-Pb for pgsql-general@lists.postgresql.org; Mon, 19 Aug 2024 12:50:56 +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 1sg1qW-000Rbr-Hi for pgsql-general@lists.postgresql.org; Mon, 19 Aug 2024 12:50:55 +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 47JCopqg1352495; Mon, 19 Aug 2024 08:50:51 -0400 From: Tom Lane To: plsqlvids01 plsqlvids01 cc: pgsql-general@lists.postgresql.org Subject: Re: use of postgres reg* datatypes in user tables? In-reply-to: References: Comments: In-reply-to plsqlvids01 plsqlvids01 message dated "Mon, 19 Aug 2024 02:08:48 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1352493.1724071851.1@sss.pgh.pa.us> Date: Mon, 19 Aug 2024 08:50:51 -0400 Message-ID: <1352494.1724071851@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk plsqlvids01 plsqlvids01 writes: > What is the use of postgres regclass datatype in user tables? When would > one want to use them when regular data types are available? If any tables > have these data types, since pg_upgrade would fail, what data types should > those be converted to? Indeed, storing reg* types in user tables isn't particularly recommended because of the pg_upgrade problem. However, casting to a reg* type is plenty useful in queries on the system catalogs. There is more info and examples in the manual: https://www.postgresql.org/docs/current/datatype-oid.html regards, tom lane