Re: to_regtype() Raises Error

Поиск
Список
Период
Сортировка
От Chapman Flack
Тема Re: to_regtype() Raises Error
Дата
Msg-id b96eb6e0140ddaa86a0f97e9d78b247c@anastigmatix.net
обсуждение исходный текст
Ответ на Re: to_regtype() Raises Error  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: to_regtype() Raises Error  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
On 2023-09-17 20:58, David G. Johnston wrote:
> Put differently, there is no syntax involved when the value being 
> provided
> is the text literal name of a type as it is stored in pg_type.typname, 
> so
> the presence of a syntax error is wrong.

Well, the situation is a little weirder than that, because of the 
existence
of SQL standard types with multiple-token names; when you provide the
value 'character varying', you are not providing a name found in
pg_type.typname (while, if you call the same type 'varchar', you are).
For 'character varying', the parser is necessarily involved.

The case with 'interval second' is similar, but even different still;
that isn't a multiple-token type name, but a type name with a
standard-specified bespoke way of writing a typmod. Another place
the parser is necessarily involved, doing another job. (AFAICT,
to_regtype is happy with a typmod attached to the input, and
happily ignores it, so to_regtype('interval second') gives you
interval, to_regtype('character varying(20)') gives you
character varying, and so on.)

Regards,
-Chao



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: to_regtype() Raises Error
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: to_regtype() Raises Error