postgresql_16:5.3.6.6 The decimal Type
PostgreSQL 16 > Client Interfaces > ECPG — Embedded SQL in C > pgtypes Library > The decimal Type
The decimal type is similar to the numeric type. However it is limited to a maximum precision of 30 significant digits. In contrast to the numeric type which can be created on the heap only, the decimal type can be created either on the stack or on the heap (by means of the functions PGTYPESdecimal_new and PGTYPESdecimal_free). There are a lot of other functions that deal with the decimal type in the Informix compatibility mode described in (see postgresql_16:5.3.15).
The following functions can be used to work with the decimal type and are not only contained in the libcompat library. PGTYPESdecimal_new Request a pointer to a newly allocated decimal variable. decimal *PGTYPESdecimal_new(void); PGTYPESdecimal_free Free a decimal type, release all of its memory. void PGTYPESdecimal_free(decimal *var);