Re: Moving a simple function to pl/pgsql (Novice question)

From: Paul Lambert <paul(dot)lambert(at)autoledgers(dot)com(dot)au>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Moving a simple function to pl/pgsql (Novice question)
Date: 2007-04-04 22:20:01
Message-ID: 46142491.2080808@autoledgers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Richard Broersma Jr wrote:
> --- Paul Lambert <paul(dot)lambert(at)autoledgers(dot)com(dot)au> wrote:
>> The purpose being when a row in a table in one database is updated, it
>> will copy (or replicate I guess) the record into a different table into
>> another database in the same server. (deleting said record first if it
>> already exists)
>>
>> What is the best way to do this within Postgres?
>
> In postgresql, there are two parts to implementing a trigger; the trigger function and the actual
> trigger on the table that calls this function.
>
> Here is a good example:
> http://www.postgresql.org/docs/8.2/interactive/plpgsql-trigger.html#PLPGSQL-TRIGGER-AUDIT-EXAMPLE
>
> One other point to be aware of, Postgresql does not allow your to reference other databases in the
> DB-cluster directly. It is possible but you need to add a contrib module called dblink:
> http://pgfoundry.org/projects/snapshot/
>
> Hope this helps,
> Regards,
> Richard Broersma Jr.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>
>

Perfect, thanks Richard.

Regards,
Paul.

--
Paul Lambert
Database Administrator
AutoLedgers

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Sumeet 2007-04-05 03:17:54 slow query
Previous Message Jonah H. Harris 2007-04-04 14:02:20 Re: CPU statistics