Bob Henkel <bob(dot)henkel(at)gmail(dot)com> writes:
> I assume it's feasible to embedd ECPG in a Postgres Stored function
> written in C?
No, I don't think so; or at least that's not the expected usage. ECPG
expects to connect to an external server. The normal way to issue
SQL from C-level backend code is to use the SPI interface:
http://www.postgresql.org/docs/8.3/static/spi.html
regards, tom lane