to_regtype() Raises Error

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема to_regtype() Raises Error
Дата
Msg-id 09F9CAD6-5096-43CC-B6A7-685703E4714D@justatheory.com
обсуждение исходный текст
Ответы Re: to_regtype() Raises Error
Список pgsql-hackers
The docs for `to_regtype()` say, “this function will return NULL rather than throwing an error if the name is not
found.”And it’s true most of the time: 

david=# select to_regtype('foo'), to_regtype('clam');
 to_regtype | to_regtype
------------+------------
 [null]     | [null]

But not others:

david=# select to_regtype('inteval second');
ERROR:  syntax error at or near "second"
LINE 1: select to_regtype('inteval second');
                ^
CONTEXT:  invalid type name "inteval second”

I presume this has something to do with not catching errors from the parser?

david=# select to_regtype('clam bake');
ERROR:  syntax error at or near "bake"
LINE 1: select to_regtype('clam bake');
             ^
CONTEXT:  invalid type name "clam bake"

Best,

David


Вложения

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

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: JSON Path and GIN Questions
Следующее
От: Erik Wienhold
Дата:
Сообщение: Re: to_regtype() Raises Error