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

Docbug, SPI_getbinval, triger example

From: mlw <markw(at)mohawksoft(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Docbug, SPI_getbinval, triger example
Date: 2001-11-30 17:09:43
Message-ID: 3C07BD57.E43142B1@mohawksoft.com (view raw or flat)
Thread:
Lists: pgsql-hackers
The docs suggest that this:

        /* Get number of tuples in relation */
        ret = SPI_exec("select count(*) from ttest", 0);

        if (ret < 0)
                elog(NOTICE, "trigf (fired %s): SPI_exec returned %d",
when, ret);

        i = SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc,
1, &isnull);
        elog (NOTICE, "trigf(fired %s): there are %d tuples in ttest",
when, i);


When it should be:

        pi = SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc,
1, &isnull);
        elog (NOTICE, "trigf(fired %s): there are %d tuples in ttest",
when, *pi);





Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2001-11-30 17:29:31
Subject: Re: History question
Previous:From: Nicolas VergerDate: 2001-11-30 17:02:30
Subject: Re: [HACKERS] JDBC improvements

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group