Re: Extending SQL in C using VARIABLE length type - Mailing list pgsql-general

From Yeb Havinga
Subject Re: Extending SQL in C using VARIABLE length type
Date
Msg-id 4B7292A9.3030400@gmail.com
Whole thread Raw
In response to Re: Extending SQL in C using VARIABLE length type  (Carsten Kropf <ckropf2@fh-hof.de>)
Responses Re: Extending SQL in C using VARIABLE length type  (Carsten Kropf <ckropf2@fh-hof.de>)
List pgsql-general
Carsten Kropf wrote:
> Actually, I thought, I did this using the int32 variable called
> "dimension" which should be exactly this field.
yes.
> in = (PointND *) palloc(sizeof(float8) * dimensions + VARHDRSZ);
> SET_VARSIZE(in, dimensions);
What about

len = sizeof(float8) * dimensions + VARHDRSZ;
in = (PointND *) palloc0(len);
SET_VARSIZE(in, len);



pgsql-general by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: when a table was last vacuumed
Next
From: Carsten Kropf
Date:
Subject: Re: Extending SQL in C using VARIABLE length type