On sön, 2010-10-31 at 18:50 +0200, Heikki Linnakangas wrote:
> Yeah, that was my first impression too. I assumed that TypeInfo would be
> embedded in other structs directly, rather than a pointer and palloc.
> Something like:
>
> /*
> * TypeInfo - encapsulates type information
> */
> typedef struct TypeInfo
> {
> Oid typeid;
> int32 typmod;
> } TypeInfo;
> ...
> typedef struct Const
> {
> Expr xpr;
> - Oid consttype; /* pg_type OID
> of the constant's datatype */
> - int32 consttypmod; /* typmod value, if any */
> + TypeInfo consttype; /* type information of the
> constant's datatype */
> int constlen; /* typlen of
> the constant's datatype */
> Datum constvalue; /* the constant's value */
That's another possibility, but you can't stick TypeInfo into a list
that way.