postgres server function

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Apr 2006
Posts: 1
Reputation: maciek1024 is an unknown quantity at this point 
Solved Threads: 0
maciek1024 maciek1024 is offline Offline
Newbie Poster

postgres server function

 
0
  #1
Apr 28th, 2006
Hi,

I need to use function:
SPI_modifytuple
HeapTuple SPI_modifytuple(Relation rel, HeapTuple row, ncols, colnum, Datum * values, const char * nulls)
How can I get object Relation?
If I insert NULL as relation function does not modify tuples.
I have found an example, when the function was called by trigger.

Relation rel;
TriggerData *trigdata = (TriggerData *) fcinfo->context;
rel = trigdata->tg_relation;

Maybe it works fine with trigger, but I am calling myFunction from sql like:
select myFunction();

How to get Relation?
Can anybody help me?

Regards,
Maciej Banasiak
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,461
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 254
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: postgres server function

 
0
  #2
Apr 28th, 2006
Your best bet would probably be in the documentation for that function.

I'd have to start here.
http://www.google.com/search?q=SPI_m...PI_modifytuple
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1010 | Replies: 1
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC