Re: difficulty extracting variable-sized field on triggered row

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Glen W(dot) Mabey" <Glen(dot)Mabey(at)swri(dot)org>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: difficulty extracting variable-sized field on triggered row
Date: 2007-12-04 15:53:37
Message-ID: 28769.1196783617@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Glen W. Mabey" <Glen(dot)Mabey(at)swri(dot)org> writes:
> Is there somewhere that I am not adequately checking for an error?

1. You're passing SPI_getbinval an uninitialized bool pointer.

2. You're discarding its result, which you need.

3. You're not checking for a null, and the error check you do have
is wrong/redundant.

4. Use DatumGetTextP(), not DatumGetPointer nor PG_DETOAST_DATUM.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2007-12-04 16:05:10 Re: WAL shipping question
Previous Message Alvaro Herrera 2007-12-04 15:51:23 Re: difficulty extracting variable-sized field on triggered row