Having thought about this for a min or three, I think the best
solution
would be the following:
BEGIN;
CREATE TEMP TABLE newmsg (
.... -- Whatever schema is necessary
) ON COMMIT DROP;
INSERT INTO other_tbl SELECT foo1, foo2, ${user_id} FROM newmsg;
-- repeat insert as necessary
COMMIT;
The only problem I can think of is foreign-key relationships that
require
one or more physmessages to point to a messageblk. We'll also need a
special version of db_copymsg that selects from the temp table rather
than
the disk table.
Don't worry about foreign keys in a temp table, the master table that
you insert this data into will enforce that. -sc
--
Sean Chittenden