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: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, 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>, 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-03-08 04:39:34
Message-ID: tdiav2jrai6vds7xtijx3db7k6voehk73rptsnfc5pcsn2n3ht@ocr5sleep5j3
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi David,

On 2024-03-08 02:37 +0100, David E. Wheeler wrote:
> I’ve rebased the patch and, in an attempt to clarify this behavior,
> added a couple of examples to the docs for to_regtype. Updated patch
> attached.

On your latest addition:

> + <xref linkend="datatype-oid"/>). Failure to extract a valid potential
> + type name results in an error. For example:
> +<programlisting>
> +SELECT to_regtype('party');
> + to_regtype
> +------------
> +
> +</programlisting>
> + However, if the extracted name is not known to the system, this function
> + will return <literal>NULL</literal>. For example:
> +<programlisting>
> +SELECT to_regtype('interval nonesuch');
> +ERROR: syntax error at or near "nonesuch"
> +LINE 1: select to_regtype('interval nonesuch');
> + ^
> +CONTEXT: invalid type name "interval nonesuch"
> +</programlisting>

I think you need to swap the examples. The text mentions the error case
first and the NULL case second.

--
Erik

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2024-03-08 05:09:21 Re: Synchronizing slots from primary to standby
Previous Message Michael Paquier 2024-03-08 04:32:10 Re: ALTER TABLE SET ACCESS METHOD on partitioned tables