Re: Cannot create canonicalization function for user-defined range type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Cannot create canonicalization function for user-defined range type
Дата
Msg-id 596023.1611157891@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Cannot create canonicalization function for user-defined range type  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Wed, Jan 20, 2021 at 5:00 AM Avery Fischer <biggerfisch@gmail.com> wrote:
>> ERROR:  PL/pgSQL functions cannot return type myrange
>> Am I misunderstanding the docs, or are they out-of-date, or is something
>> else going on? How can I create a canonicalization function for my range
>> type?

> Thus one needs to write a C language function if one wishes to implement a
> custom range.

Yeah, that's the only way at the moment.  We've not seen much use-case
for writing canonicalization functions in PLs, because of (a) performance
and (b) circularity concerns --- the latter meaning that the PL's own
infrastructure is likely to expect that it can manipulate scalar values
without incurring recursion.  These are pretty much the same reasons
why a datatype's I/O functions can't be written in a PL.

            regards, tom lane



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Cannot create canonicalization function for user-defined range type
Следующее
От: Michael Lewis
Дата:
Сообщение: Re: upgrade using logical replication