pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: vivek@staff.ownmail.com
To: pgsql-interfaces@postgresql.org
Subject: Re: SPI_getvalue gives a core dump
Date: Fri, 28 Jul 2006 22:32:14 +0530
Message-ID: <200607281702.k6SH2Est002686@mail009.ownmail.com> (raw)

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@staff.ownmail.com
Trikon electronics Pvt. Ltd.

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



Tom Lane wrote:
> ><vivek@staff.ownmail.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@postgresql.org so that your
>       message can get through to the mailing list cleanly





view thread (5+ messages)

Message-ID: <200607281702.k6SH2Est002686@mail009.ownmail.com>
Permalink:  ../200607281702.k6SH2Est002686@mail009.ownmail.com/
Also on:    postgresql.org/message-id/200607281702.k6SH2Est002686@mail009.ownmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: vivek@staff.ownmail.com
  Subject: Re: SPI_getvalue gives a core dump
  In-Reply-To: <200607281702.k6SH2Est002686@mail009.ownmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox