Re: Patch: Add parse_type Function

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Erik Wienhold <ewie(at)ewie(dot)name>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Patch: Add parse_type Function
Date: 2024-02-21 15:14:02
Message-ID: 2312D04F-C4AA-4A91-83DB-0B415C9B884B@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Feb 20, 2024, at 21:09, Erik Wienhold <ewie(at)ewie(dot)name> wrote:

> The references are printed as "???" right now. Can be fixed with
> xreflabel="format_type" and xreflabel="to_regtype" on those <entry>
> elements.

Thanks.

> The docs show parameter name "type" but pg_proc.data does not define
> proargnames. So the to_regtypemod() cannot be called using named
> notation:
>
> test=> select to_regtypemod(type => 'int'::text);
> ERROR: function to_regtypemod(type => text) does not exist

Yes, this format is identical to that of to_regtype():

david=# select to_regtype(type => 'int'::text);
ERROR: function to_regtype(type => text) does not exist

> + Parses a string of text, extracts a potential type name from it, and
>> + translates its typmod, the modifier for the type, if any. Failure to
>
> s/typmod, the modifier of the type/type modifier/
>
> Because format_type() already uses "type modifier" and I think it helps
> searchability to use the same wording.

Yes, definitely better wording, thanks. V8 attached.

Best,

David

Attachment Content-Type Size
v8-0001-Add-to_regtypemod-SQL-function.patch application/applefile 104 bytes
unknown_filename text/plain 2 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-02-21 15:31:57 Re: pg_restore option --clean
Previous Message Maxim Orlov 2024-02-21 15:08:54 Re: POC: GROUP BY optimization