I solve it myself again. : )
There is SPI (server programming interface) for these purposes.
To execute an SQL command in external function u should first include "executor/spi.h", then
Code:
SPI_connect();
SPI_execute(...);
SPI_finish();
And it should work... If only u will not get linker error as I do : (
Code:
trigf.obj : error LNK2001: unresolved external symbol _SPI_finish
trigf.obj : error LNK2001: unresolved external symbol _SPI_execute
trigf.obj : error LNK2001: unresolved external symbol _SPI_connect
Looks like I miss some libraries or .def files...