Re: to_regtype() Raises Error
От | Vik Fearing |
---|---|
Тема | Re: to_regtype() Raises Error |
Дата | |
Msg-id | 706e44d3-a5cb-5483-9291-b663698fdf35@postgresfriends.org обсуждение исходный текст |
Ответ на | Re: to_regtype() Raises Error (Erik Wienhold <ewie@ewie.name>) |
Ответы |
Re: to_regtype() Raises Error
Re: to_regtype() Raises Error Re: to_regtype() Raises Error |
Список | pgsql-hackers |
On 9/18/23 00:41, Erik Wienhold wrote: > On 18/09/2023 00:13 CEST David E. Wheeler <david@justatheory.com> wrote: > >> 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” > > Probably a typo and you meant 'interval second' which works. No, that is precisely the point. The result should be null instead of an error. -- Vik Fearing
В списке pgsql-hackers по дате отправления: