vsql_complex adds a COMPLEX column type that stores a complex number as two
doubles, with the arithmetic to go with it. It ships inside the server as a
worked example of a custom type, and it shows what a VEF type needs end to end:
a binary layout, a text form, a comparison rule, and an aggregate.
Install
vsql_complex lives in the server source tree, so its bundle is present after
every install method, including a build from source. Install it into the server
with one statement:
What it adds
The COMPLEX type
A value is written'(real,imaginary)' and occupies 16 bytes. The bundle also
registers a COMPLEX2 variant, which this page does not cover.
Functions
Example
(0,1) rotates a value a quarter turn, and the aggregate adds a
whole column:
See also
- Custom types — how a VEF type is declared, and what the server asks of it
- Create an extension — building one of your own
- Available extensions — the full catalog

