Re: Patch: Add parse_type Function

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
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 02:09:59
Message-ID: fygcwiamrggvwbvc3hnigdhrpsuwjfqgyhmu7nxq5cpy7myv5d@le3bvr74lbwj
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024-02-20 15:44 +0100, David E. Wheeler wrote:
> I’ve tweaked the comments and their order in v7, attached.
>
> This goes back to the discussion of the error raising of
> to_regtype[1], so I’ve incorporated the patch from that thread into
> this patch, and set up the docs for to_regtypemod() with similar
> information.

Makes sense.

> [1] https://www.postgresql.org/message-id/flat/57E1FDDC-5A38-452D-82D7-A44DA2E13862%40justatheory.com#1ae0b11634bc33c7ad3cd728e43d504e

> - <entry role="func_table_entry"><para role="func_signature">
> + <entry id="format_type" role="func_table_entry"><para role="func_signature">
> <indexterm>
> <primary>format_type</primary>
> </indexterm>
> @@ -25462,7 +25462,7 @@ SELECT collation for ('foo' COLLATE "de_DE");
> </row>
>
> <row>
> - <entry role="func_table_entry"><para role="func_signature">
> + <entry id="to_regtype" role="func_table_entry"><para role="func_signature">

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

> + <function>to_regtypemod</function> ( <parameter>type</parameter> <type>text</type> )

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

> + 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.

--
Erik

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2024-02-21 02:15:57 RE: Have pg_basebackup write "dbname" in "primary_conninfo"?
Previous Message Jacob Champion 2024-02-21 01:00:28 Re: [PoC] Federated Authn/z with OAUTHBEARER