View Single Post

   
  #2 (permalink)  
Old 04-09-2008, 10:20 AM
Tom Lane
 
Posts: n/a
Default Re: plpgsql replication stored procedure

aaron.clauson@gmail.com writes:
> I'm trying to write a stored procedure that can capture all the changes
> to a table and record the changes based on the table's primary key.
> I can almost get there but the sticking point is being able to access
> the primary key field of the NEW/OLD record in the trigger stored
> procedure without knowing it's name.


There is no way to write such a generic trigger in plpgsql (and even if
you could, its performance would suck :-(). You could do it in C if
you're sufficiently determined.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Reply With Quote