Re: plpgsql replication stored procedure

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: aaron(dot)clauson(at)gmail(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: plpgsql replication stored procedure
Date: 2006-04-17 19:21:47
Message-ID: 4358.1145301707@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

aaron(dot)clauson(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Yudie Pg 2006-04-17 19:48:09 tsearch partial word
Previous Message Peter Eisentraut 2006-04-17 19:16:10 Re: the integer type