Re: Patch: Add parse_type Function
От | Erik Wienhold |
---|---|
Тема | Re: Patch: Add parse_type Function |
Дата | |
Msg-id | tdiav2jrai6vds7xtijx3db7k6voehk73rptsnfc5pcsn2n3ht@ocr5sleep5j3 обсуждение исходный текст |
Ответ на | Re: Patch: Add parse_type Function ("David E. Wheeler" <david@justatheory.com>) |
Ответы |
Re: Patch: Add parse_type Function
|
Список | 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
В списке pgsql-hackers по дате отправления: