Re: Patch: Add parse_type Function

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: Patch: Add parse_type Function
Дата
Msg-id B13EBBAB-AE1A-42AA-B5E9-EB05CA4EA47E@justatheory.com
обсуждение исходный текст
Ответ на Re: Patch: Add parse_type Function  (Erik Wienhold <ewie@ewie.name>)
Ответы Re: Patch: Add parse_type Function  (jian he <jian.universality@gmail.com>)
Список pgsql-hackers
On Feb 19, 2024, at 21:58, Erik Wienhold <ewie@ewie.name> wrote:

> See the patch I wrote for my benchmarks.  But it's pretty easy anyway to
> cut down parse_type() ;)

LOL, I missed that, just wrote it myself in the last hour. :-) v6 attached.

> But you don't actually need reformat_type() in pgTAP.  You can just get
> the type OID and modifier of the want_type and have_type and compare
> those.  Then use format_type() for the error message.  Looks a bit
> cleaner to me than doing the string comparison.

Fair.

> On second thought, I guess comparing the reformatted type names is
> necessary in order to have a uniform API on older Postgres releases
> where pgTAP has to provide its own to_regtypmod() based on typmodin
> functions.

Maybe. Worth playing with.

>> For the latter, it could easily be an example in the docs.
> 
> Can be mentioned right under format_type().

Well I included it in the to_regtypemod docs here, but could so either.

Best,

David


Вложения

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

Предыдущее
От: Erik Wienhold
Дата:
Сообщение: Re: Patch: Add parse_type Function
Следующее
От: Andrei Lepikhov
Дата:
Сообщение: Re: POC, WIP: OR-clause support for indexes