Re: Try adding type cast with tablespace

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kenichiro Tanaka <kenichirotanakapg(at)gmail(dot)com>
Cc: 程ゆき <yukiteipg(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Try adding type cast with tablespace
Date: 2023-09-29 01:12:36
Message-ID: 1128067.1695949956@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kenichiro Tanaka <kenichirotanakapg(at)gmail(dot)com> writes:
> Therefore I think it is good to add regtablespace alias,but I’m also
> newbie pgsql-hackers.
> We need some senior hackers’s opinions.

Well ... for my two cents, I'm kind of down on this, mainly because
I don't understand where we'd stop. I don't want to end up in a
scenario where every system catalog is expected to have a reg*
type to go with it, because that'd create a lot of make-work.

The original idea of the reg* types was to create an easy way to do
OID lookups in catalogs where the correct lookup rule is more
complicated than
(SELECT oid FROM some_catalog WHERE name = 'foo')
So that motivates making reg* types for objects with
schema-qualified names, and even more so for functions and
types which have specialized syntax. There was also some
consideration of which object types frequently need lookups.
IIRC, regrole got in partly because unprivileged users can't
select from pg_authid.

I don't really see that tablespaces meet the bar of any of these
past criteria: they don't have complex lookup rules nor are they
all that commonly used (IME anyway). So if we accept this patch,
we're essentially saying that every catalog should have a reg*
type, and that's not a conclusion I want to reach. We have 11
reg* types at the moment (only 9 if you discount the legacy
regproc and regoper ones), whereas there are about 30 catalogs
that have name columns. Do we really want to open those
floodgates?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-09-29 01:17:09 Re: Allow deleting enumerated values from an existing enumerated data type
Previous Message Kenichiro Tanaka 2023-09-29 00:40:00 Re: Try adding type cast with tablespace