On Wed, Aug 16, 2006 at 02:59:23AM -0400, Harpreet Dhaliwal wrote:
> I mean can we call a stored procedure as an action of a trigger?
You'll need to write a trigger function that calls the non-trigger
function (what you're referring to as "stored procedure"). Example:
CREATE FUNCTION trigger_function() RETURNS trigger AS $$
$$ LANGUAGE plpgsql;
CREATE TRIGGER trigger_name BEFORE INSERT OR UPDATE ON table_name
FOR EACH ROW EXECUTE PROCEDURE trigger_function();
> Its actually something like the trigger should start a C function after
> insert and the C function has the ECPG code for some more inserts.
> Its similar to the way we dynamically load a shared library while
> executing a stored procedure, as in , executing a fucntion in C file using
> stored procedure/ function.
You have a server-side C function that uses ECPG? Is there a reason
you're not using SPI? Are you connecting to a different server?
Or by "function" do you really mean "program," meaning a separate
In response to
pgsql-novice by date
|Next:||From: Jasbinder Bali||Date: 2006-08-16 18:42:46|
|Subject: Re: [NOVICE] DB insert Error|
|Previous:||From: Tom Lane||Date: 2006-08-16 17:14:57|
|Subject: Re: libpq Describe Extension [WAS: Bytea and perl] |
pgsql-general by date
|Next:||From: Stephan Szabo||Date: 2006-08-16 17:44:11|
|Subject: Re: Weird join result|
|Previous:||From: Jeff Davis||Date: 2006-08-16 17:36:54|
|Subject: Re: Determine Transactions Per Second|