[prev] 26 [next]

PostgreSQL Attribute Values (cont)

Values of Datum objects can be manipulated via e.g.

// DatumGetBool:
//   Returns boolean value of a Datum.

#define DatumGetBool(X) ((bool) ((X) != 0))

// BoolGetDatum:
//   Returns Datum representation for a boolean.

#define BoolGetDatum(X) ((Datum) ((X) ? 1 : 0))

For details, see include/postgres.h