why can't see the updated value after SPI_execute("update ....", false, 1);

From: sunpeng <bluevaley(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: why can't see the updated value after SPI_execute("update ....", false, 1);
Date: 2010-09-12 12:25:27
Message-ID: AANLkTi=mkfGXmbbWLmRkL1wGbbMNqmSHQw0ht6TJKKvs@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

First I use SPI_execute("update ....
bool succ;
SPI_connect();
int ret = SPI_execute("update ....where uid = 1", false, 1);//later will
add error processing
if (ret == SPI_OK_UPDATE && SPI_processed == 1) {
succ = true;
}
SPI_finish();

Then I use SPI_execute("select .....where uid = 1", ....

SPI_connect();
int ret = SPI_execute("select .....where uid = 1", true, 1);//later will
add error processing
if (ret == SPI_OK_SELECT && SPI_processed == 1) {
HeapTuple tuple;
tuple = SPI_tuptable->vals[0];
...
datum = heap_getattr(tuple,attrno,SPI_tuptable->tupdesc,&isnull);
....
}
the datum doesn't change, why ?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2010-09-12 12:34:23 Re: How to inherit search_path from template
Previous Message Martijn van Oosterhout 2010-09-12 11:32:00 Re: Incrementally Updated Backups