public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: plsqlvids01 plsqlvids01 <[email protected]>
Cc: [email protected]
Subject: Re: use of postgres reg* datatypes in user tables?
Date: Mon, 19 Aug 2024 08:50:51 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFsfSrs+_7Aie27FPB+HnH0vEeT3h=5ZJj7k=OWDYTGksmYPiw@mail.gmail.com>
References: <CAFsfSrs+_7Aie27FPB+HnH0vEeT3h=5ZJj7k=OWDYTGksmYPiw@mail.gmail.com>

plsqlvids01 plsqlvids01 <[email protected]> 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






reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: use of postgres reg* datatypes in user tables?
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox