Re: Patch: Add parse_type Function

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: Patch: Add parse_type Function
Дата
Msg-id 782054B4-05DC-4251-AC63-62AA898C8927@justatheory.com
обсуждение исходный текст
Ответ на Re: Patch: Add parse_type Function  (Jim Jones <jim.jones@uni-muenster.de>)
Ответы Re: Patch: Add parse_type Function  ("David E. Wheeler" <david@justatheory.com>)
Список pgsql-hackers
On Feb 24, 2024, at 19:11, Jim Jones <jim.jones@uni-muenster.de> wrote:

>> What’s the protocol for marking a patch ready for committer?
>
> I guess after the review of the last assigned reviewer

Oh, I didn’t realize someone was assigned. :-)

> The fact that a completely invalid type returns NULL ..
>
> SELECT to_regtypemod('foo');
>  to_regtypemod
> ---------------
>
> (1 row)
>
>
> .. but a "partially" valid one returns an error might be confusing
>
> postgres=# SELECT to_regtypemod('timestamp(-4)');
> ERROR:  syntax error at or near "-"
> LINE 1: SELECT to_regtypemod('timestamp(-4)');
>                   ^
> CONTEXT:  invalid type name "timestamp(-4)"
>
> postgres=# SELECT to_regtypemod('text(-4)');
> ERROR:  type modifier is not allowed for type "text"

Yeah, there was quite a bit of discussion of this issue back in September[1].

> This behaviour is mentioned in the documentation, so I'd say it is ok.

This is my attempt to make it clearer that it can return an error, but I don’t love the wording TBH.

> I would personally prefer either NULL or an error in both cases, but I
> can totally live with the current design.

SAME.

Best,

David

[1] https://www.postgresql.org/message-id/flat/09F9CAD6-5096-43CC-B6A7-685703E4714D@justatheory.com




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: libpq: PQfnumber overload for not null-terminated strings
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: Transaction timeout