Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: SPI_getvalue gives a core dump



I have already tried it out. I tried the following:- 
char *myval
1) i = DatumGetInt64(SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1, &isnull));
2) myval=SPI_getvalue(trigdata->tg_trigtuple, tupdesc, 17);
3) myval=SPI_getvalue(trigdata->tg_trigtuple, trigdata->tg_relation->rd_att, 17);
4) myval=strdup(SPI_getvalue(trigdata->tg_trigtuple, trigdata->tg_relation->rd_att, 17));
5) if ((myval=SPI_getvalue(trigdata->tg_trigtuple, trigdata->tg_relation->rd_att, 17))==NULL) then, log and exit.


With warm regards.

Vivek J. Joshi.

vivek(at)staff(dot)ownmail(dot)com
Trikon electronics Pvt. Ltd.

All science is either physics or stamp collecting.
                -- Ernest Rutherford



Tom Lane wrote:
> ><vivek(at)staff(dot)ownmail(dot)com> writes:
>>                 i = DatumGetInt64(SPI_getbinval(SPI_tuptable->vals[0], 
tupdesc, 1, &isnull));
>
>I think this is your problem: you're trying to use the wrong tupdesc to
>retrieve from the SELECT count(*) result.  SPI_tuptable->tupdesc would
>work better there.
>
>			regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>       message can get through to the mailing list cleanly





Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group