From: | Carsten Kropf <ckropf2(at)fh-hof(dot)de> |
---|---|
To: | Yeb Havinga <yebhavinga(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Extending SQL in C using VARIABLE length type |
Date: | 2010-02-10 11:09:18 |
Message-ID: | 6FA09450-E1EB-431A-AA59-7AD4272D0E40@fh-hof.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Oh, I see, does the VARSIZE length field have to be the total number of bytes occupied (including VARHDRSZ and the size of the structure) or only the size that is used by "my" datatype? Then it would become pretty much obvious, why this is not supposed to work.
I'll try it out then.
regards
Carsten Kropf
Am 10.02.2010 um 12:04 schrieb Yeb Havinga:
> 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);
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Stark | 2010-02-10 11:17:59 | Re: 8.5devel: unexpected and illogical error during transaction, but transaction don't rolled back |
Previous Message | Yeb Havinga | 2010-02-10 11:04:09 | Re: Extending SQL in C using VARIABLE length type |