Is the subtype_diff function in CREATE TYPE only can be C function?

Поиск
Список
Период
Сортировка
От ddme
Тема Is the subtype_diff function in CREATE TYPE only can be C function?
Дата
Msg-id tencent_758B97399E4F02C35B6F3B90F2ABDC75A909@qq.com
обсуждение исходный текст
Ответы Re: Is the subtype_diff function in CREATE TYPE only can be C function?  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Список pgsql-hackers
Hi all,

I notice that the CREATE TYPE syntax can specify subtype_diff function
CREATE TYPE name AS RANGE (    SUBTYPE = subtype    [ , SUBTYPE_OPCLASS = subtype_operator_class ]    [ , COLLATION = collation ]    [ , CANONICAL = canonical_function ]    [ , SUBTYPE_DIFF = subtype_diff_function ] <————— here    [ , MULTIRANGE_TYPE_NAME = multirange_type_name ]
)
And a example is
```sql
CREATE TYPE float8_range AS RANGE (subtype = float8, subtype_diff = float8mi);
```

I notice that float8mi is a C function, and I find the call_subtype_diff() in source code that it seems only can call C function.

I want to know

1. Can the subtype_diff function in CREATE TYPE be sql or plpgsql function?
2. How to call subtype_diff function? I know it related with GiST index, I need a example on how to trigger subtype_diff function.

What’s more,  I want to learn how Postgres kernel call subtype_diff function (in which source file or function), that will help me a lot.
 

Thank you all!

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows
Следующее
От: Sutou Kouhei
Дата:
Сообщение: Re: Make COPY format extendable: Extract COPY TO format implementations