Re: [HACKERS] Segfault using heap_form_tuple

2008-04-09 Thread Tom Lane
"Claudio Rossi" <[EMAIL PROTECTED]> writes: > You guessed it right, I was trying to "CStringGetDatum" into a text field, > now i solved it with > values[n] = DirectFunctionCall1(textin, CStringGetDatum(...string...)); If you're working in CVS HEAD there's an easier way --- see CStringGetTextDatu

Re: [HACKERS] Segfault using heap_form_tuple

2008-04-09 Thread Claudio Rossi
> You've omitted the details that probably matter. My guess is that > you're inappropriately converting one of these values to a Datum, > or converting it to a Datum that's not really of the type the > tuple descriptor specifies. > > regards, tom lane Mate, you just won a be

Re: [HACKERS] Segfault using heap_form_tuple

2008-04-09 Thread Claudio Rossi
> > nulls = (bool *)palloc(natts*sizeof(bool *)); > > > > May not be related to segfault you are seeing, but this looks completely > wrong. > You want array of bool and not (bool *). Yeah, you are right but in the original code it's: values = (Datum *) palloc(natts * sizeof(Datum)); nulls = (bo

Re: [HACKERS] Segfault using heap_form_tuple

2008-04-09 Thread Tom Lane
"Claudio Rossi" <[EMAIL PROTECTED]> writes: > values[0] = ...GetDatum(...my datum...); > ... > values[natts-1] = ...GetDatum(...my datum...); You've omitted the details that probably matter. My guess is that you're inappropriately converting one of these values to a Datum, or converting it to a D

Re: [HACKERS] Segfault using heap_form_tuple

2008-04-09 Thread Pavan Deolasee
On Wed, Apr 9, 2008 at 10:48 PM, Claudio Rossi <[EMAIL PROTECTED]> wrote: > nulls = (bool *)palloc(natts*sizeof(bool *)); > May not be related to segfault you are seeing, but this looks completely wrong. You want array of bool and not (bool *). Thanks, Pavan -- Pavan Deolasee EnterpriseDB h