Re: Trigger programming.. - Mailing list pgsql-general

From Tom Lane
Subject Re: Trigger programming..
Date
Msg-id 20981.962404749@sss.pgh.pa.us
Whole thread Raw
In response to Trigger programming..  ("Mitch Vincent" <mitch@venux.net>)
List pgsql-general
"Mitch Vincent" <mitch@venux.net> writes:
> I have this code...

>  tupdesc = rel->rd_att;  /* what the tuple looks like (?) */

>  app_id_colnum = SPI_fnumber(tupdesc, app_id_fieldname);

>   if (app_id_colnum == SPI_ERROR_NOATTRIBUTE)
>    elog(ERROR, "app_id_colnum - SPI_ERROR_NOATTRIBUTE error ");

>  char_app_id = SPI_getvalue(rettuple, tupdesc, app_id_colnum);

Looks OK to me, as far as it goes.  I'd wonder whether the tuple
actually matches the tupdesc you're using.

Looking at SPI_getvalue itself (in src/backend/executor/spi.c),
I can see that SPI_result might offer a clue about why it's failing.

            regards, tom lane

pgsql-general by date:

Previous
From: "Steve Wolfe"
Date:
Subject: Re: Performance of Postgres via network connections
Next
From: Philip Warner
Date:
Subject: Re: pg_dumpall and check constraints