Re: "name" vs "alias" in datatype table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Eric Hanson <eric(at)aquameta(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: "name" vs "alias" in datatype table
Date: 2023-11-29 16:26:46
Message-ID: 308440.1701275206@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Eric Hanson <eric(at)aquameta(dot)com> writes:
> The larger point being, the "name" vs "alias" paradigm presented in this
> table does not accurately represent PostgreSQL, and conveys an inaccurate
> picture of the relationship between type names. int4 is not an "alias".

I agree that this could be improved, mainly because it's far from
clear what the internal name of each type is (and there's at least
one case where the internal name is not shown at all).

I could see splitting this into three columns:

1. Preferred name (the standard's name, if it's a standard type)

2. Internal name (pg_type.typname), perhaps only if different from #1

3. Other aliases

However, the table is already pretty wide and so adding another
column might create formatting issues.

AFAICS the only candidates for "other aliases" are char, int,
and decimal. Maybe we could handle those another way than reserving
a table column for them? We could give them their own table rows,
or relegate them to footnotes.

The "serial" types need a bit more reflection too, since they
aren't truly types at all: there is no matching pg_type entry.
I'm not sure they belong here.

regards, tom lane

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Alvaro Herrera 2023-11-29 16:42:54 Re: "name" vs "alias" in datatype table
Previous Message Euler Taveira 2023-11-29 15:24:23 Re: Clarification regarding CREATE TABLE LIKE and FOREIGN KEYS