--- Susan Hoddinott <[EMAIL PROTECTED]> wrote: > Hello, > > Having scoured the relevant documentation I cannot > find anything which indicates how I simply create a > database trigger to insert into a second table after > insert on a first table, without the use of a > procedure. As I do not want return values etc. this > seems like overkill. Is it possible to create a > trigger which executes SQL directly without the need > to create a procedure? If so, what is the syntax? >
You don't need to worry about those return values; nothing will be returned to your application from a trigger function. AFAICT the only difference between PostgreSQL and other DBMSs is that (at least some) others put the procedural logic inside the "create trigger" statement, whereas PostgreSQL puts it in a separate function. You need to think about this only at statement creation time; otherwise everything works just the same. One tip: always use the "create or replace function" syntax, to avoid having your trigger become confused if you change your function definition. __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html