Re: to_regtype() Raises Error - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: to_regtype() Raises Error
Date
Msg-id CAKFQuwaxsAbuFk9Jwiw-=qoS5yTFax8v8ZY7iNm8AB5nF15oLA@mail.gmail.com
Whole thread Raw
In response to Re: to_regtype() Raises Error  (Chapman Flack <chap@anastigmatix.net>)
Responses Re: to_regtype() Raises Error
List pgsql-hackers
On Sunday, September 17, 2023, Chapman Flack <chap@anastigmatix.net> wrote:

In this one, both identifiers are part of the type name, and the
separator a little more flamboyant.

select to_regtype('character /* hi!
am I part of the type name? /* what, me too? */ ok! */ -- huh!
varying');
    to_regtype
-------------------
 character varying

So, maybe we should be saying:

Parses a string of text, extracts a potential type name from it, and translates that name into an OID.  Failure to extract a valid potential type name results in an error while a failure to determine that the extracted name is known to the system results in a null output.

I take specific exception to describing your example as a “textual type name”.

David J.

pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: Re: to_regtype() Raises Error
Next
From: jian he
Date:
Subject: Re: SQL:2011 application time