Re: Problem with heap_form_tuple error - Mailing list pgsql-general

From Tom Lane
Subject Re: Problem with heap_form_tuple error
Date
Msg-id 27404.1352129661@sss.pgh.pa.us
Whole thread Raw
In response to Problem with heap_form_tuple error  (Stephen Woodbridge <woodbri@swoodbridge.com>)
Responses Re: Problem with heap_form_tuple error  (Stephen Woodbridge <woodbri@swoodbridge.com>)
List pgsql-general
Stephen Woodbridge <woodbri@swoodbridge.com> writes:
> I'm have a problem with heap_form_tuple error
>     ERROR:  invalid memory alloc request size 1149502660
> I've read through a ton of examples and read through the code and the
> docs and I'm sure I'm doing something stupid but I'm not seeing it.

Hm ... you're setting up arguments to heap_form_tuple like this:

>              values[1] = CStringGetDatum(pstrdup(stdaddr->building));

This is only correct if the corresponding column of the tupledesc is
declared as being type "cstring", which I'm willing to bet it isn't.
heap_form_tuple does not do any type conversion --- the datums provided
have to be of the right types already.

You could feed the string through the input function for the column's
type, but perhaps what you really ought to do is use
BuildTupleFromCStrings rather than using heap_form_tuple directly.

            regards, tom lane


pgsql-general by date:

Previous
From: "Daniel Serodio (lists)"
Date:
Subject: Error registering at postgresql.org
Next
From: Achilleas Mantzios
Date:
Subject: Re: Memory issue on FreeBSD