Fetch query which triggered a rule - Mailing list pgsql-general

From Jonatan Evald Buus
Subject Fetch query which triggered a rule
Date
Msg-id 113ce31b0811200324o672497d0jccb69d2e279697e2@mail.gmail.com
Whole thread Raw
List pgsql-general
Greetings,
Is it possible to fetch the query which triggered a rule?

I.e. suppose I create the following rule:
CREATE RULE MyRule AS ON Select TO MyTable_Tbl DO INSTEAD process_query($sql);

Where $sql represents the query which triggered the rule.

Appreciate the input

Cheers
Jona

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: return MAX and when it happened
Next
From: "Sabin Coanda"
Date:
Subject: hidden errors calling a volatile function inside a stable function