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?
|
Список | pgsql-hackers |
Hi all,
I notice that the CREATE TYPE syntax can specify subtype_diff function
CREATE TYPEname
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 по дате отправления: