"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > On Thu, Feb 09, 2006 at 09:51:44AM -0700, Dennis Cote wrote: >> >program). But this didn't work. So I wrote a simple print method that takes >> >one argument and printf it to the standard out. This works and actually >> >solves my problem. >> There isn't a way to get this output printed directly, but you can >> easily create a log of your applications activity in a table and then >> use a select to dump the table. > > The problem with logging to a table is that if the transaction aborts > (ie: because there's a bug in the trigger), you won't get anything in > the table. So when you need the info most you can't get it.
In the 2.8 series, if you ATTACH to a different database after beginning a transaction and DETACH before ending the transaction, anything written to the attached database will be retained regardless of whether the transaction is committed or rolled back. If this "feature" still exists in the 3.x series, it may be of use to you for this purpose. Just attach, insert, detach as part of your trigger. (I've never tried doing that in a trigger, so caveat emptor.) Derrell