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