Re: Extending SQL in C using VARIABLE length type

From: Yeb Havinga <yebhavinga(at)gmail(dot)com>
To: Carsten Kropf <ckropf2(at)fh-hof(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Extending SQL in C using VARIABLE length type
Date: 2010-02-10 11:04:09
Message-ID: 4B7292A9.3030400@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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);

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carsten Kropf 2010-02-10 11:09:18 Re: Extending SQL in C using VARIABLE length type
Previous Message Guillaume Lelarge 2010-02-10 10:54:51 Re: when a table was last vacuumed