Whats the correct way to change trigdata->tg_relation - Mailing list pgsql-hackers

From Charles Gomes
Subject Whats the correct way to change trigdata->tg_relation
Date
Msg-id BLU002-W21A0A7B675A540F159076CAB3F0@phx.gbl
Whole thread Raw
Responses Re: Whats the correct way to change trigdata->tg_relation  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
I'm creating a simple trigger that will be called during an insert and change the destination table.
All values are going to be preserved, just the destination table will be different.

From what I see I can't modify trigdata->tg_relation.

All examples use: return Datum(trigdata->tg_trigtuple); // however tg_relation does not belong there. I'm trying to
avoindhaving to do a SPI_EXEC; 
Should I create a new heap_tuple and call heap_insert() and then Return Datum(NULL); ? Or is there another more
straightforward way of doing it?  Looks like if I call heap_insert I will have to update the indexes somehow. 

Thank you,
Charles


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: XLByte* usage
Next
From: Peter Geoghegan
Date:
Subject: Re: enhanced error fields