Dynamic pgplsql triggers

From: "Worky Workerson" <worky(dot)workerson(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Dynamic pgplsql triggers
Date: 2006-07-31 21:10:13
Message-ID: ce4072df0607311410u698ff968ga8d35bfaa853b609@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm trying to trigger a whole bunch of partitions at once (initial DB
setup) using the same plpgsql trigger. The trigger is basically the
merge trigger in the docs (i.e. UPDATE IF NOT FOUND RETURN NEW ...).

I need to use the TG_RELNAME variable within the "UPDATE" in the
trigger so that I can use the same function to trigger all of the
partitions (correct?), the problem is that I can't quite figure out
how. I figure that I will have to use EXECUTE on a string that I
build up, right? The problem that I'm having with this approach is
that some of the columns of NEW don't have a text conversion, and I'm
getting an error whenever the trigger fires. Is there a way around
this and/or a better way to trigger a bunch of partitions with the
same function?

Thanks!
-Worky

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2006-07-31 21:16:57 Re: pg_xlog not cleaned up
Previous Message Martijn van Oosterhout 2006-07-31 20:57:42 Re: Corrupted DB? could not open file pg_clog/####