Re: Get Query in Statement Level Trigger?

From: Derry Bryson <derry_bryson(at)yahoo(dot)com>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Get Query in Statement Level Trigger?
Date: 2005-07-02 14:35:22
Message-ID: 20050702143522.32014.qmail@web51005.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--- Michael Fuhr <mike(at)fuhr(dot)org> wrote:

> On Thu, Jun 30, 2005 at 10:56:21AM -0700, Derry
> Bryson wrote:
> >
> > Is it possible to get the text of the query that
> > caused the trigger within a statement level
> trigger?
>
> Not as far as I know -- somebody please correct me
> if I'm mistaken.
> Querying pg_stat_activity or calling
> pg_stat_get_backend_activity()
> don't work because of the lag in the statistics
> collector.
>
> > It looks to me like all you can get is whether it
> is a
> > an UPDATE, DELETE, or INSERT and not much in the
> way
> > of details about the what caused the trigger.
>
> You can get a little more information than that, but
> probably not
> what you're after:
>
>
http://www.postgresql.org/docs/8.0/static/plpgsql-trigger.html
>
> What information are you looking for and why? What
> problem are you
> trying to solve?
>

This is for replication. Currently I do it on row
level, but that generates lots of updates for queries
like 'delete from xxxx' where xxxx has lots of rows
which tends to bog down the replication. What I was
hoping to do was replicate on a query level.

Thanks,

Derry Bryson

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-07-02 14:44:52 Re: wrong sort order
Previous Message Alejandro D. Burne 2005-07-02 14:28:12 wrong sort order