Re: Extending SQL in C using VARIABLE length type
От | Yeb Havinga |
---|---|
Тема | Re: Extending SQL in C using VARIABLE length type |
Дата | |
Msg-id | 4B728CDC.4000505@gmail.com обсуждение исходный текст |
Ответ на | Extending SQL in C using VARIABLE length type (Carsten Kropf <ckropf2@fh-hof.de>) |
Ответы |
Re: Extending SQL in C using VARIABLE length type
|
Список | pgsql-general |
Carsten Kropf wrote: > The usage of static types with fixed length was actually no problem > for me, so I proceeded to variable length types. > I created an n-dimensional point structure called "PointND" that > contains a field of float8 values of dynamic length. I also put in a > int4/int32 field for the length specification, as required by the > documentation. So the structure looks like the following: > struct PointND > { > int32 dimensions; > float8 coordinates[1]; > }; The structure should begin with a int32 vl_len_ header. At creation / palloc time the size must be set with the SET_VARSIZE macro, and the size can be queried with the VARSIZE_ * macros -> doxygen.postgresql.org is your friend here. Take a look at e.g. contrib/cube for examples. regards, Yeb Havinga
В списке pgsql-general по дате отправления: