Re: CREATE TYPE function examples
| От | Tom Lane |
|---|---|
| Тема | Re: CREATE TYPE function examples |
| Дата | |
| Msg-id | 29500.994786206@sss.pgh.pa.us обсуждение |
| Ответ на | CREATE TYPE function examples (Roberto Mello <rmello@cc.usu.edu>) |
| Список | pgsql-sql |
Roberto Mello <rmello@cc.usu.edu> writes:
> What would the functions my_procedure_1 and my_procedure_2 look like?
src/backend/utils/adt/ is full of examples of datatype I/O procedures.
Pick an existing type that does something vaguely like your type
(at the very least pick one that uses the same kind of representation:
pass-by-value, fixed-length pass-by-reference, or variable-length),
and use its code as a model.
The only thing you need to do differently in dynamically loaded C code
than is done in the main sources is to declare version-1 calling
convention functions with PG_FUNCTION_INFO_V1(). This is assumed for
builtin functions as of 7.1, but the default for dynamically loaded
functions is to assume old-style calling conventions.
regards, tom lane
В списке pgsql-sql по дате отправления: