Re: how to view original source of rules?

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: "Ed L(dot)" <pggeneral(at)bluepolka(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to view original source of rules?
Date: 2002-11-26 21:23:02
Message-ID: 20021126212302.GH5766@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 26, 2002 at 02:08:52PM -0700, Ed L. wrote:
>
> I know about this query...
>
> SELECT * FROM pg_rewrite where r.rulename = 'myrule';
>
> ...but the output is none too friendly to look at.
>
> Anyone know how one can see something closer to the original input
> source of a rule via psql?

Did you look at the pg_rules view? Also look at its definition (\d
pg_rules), it uses a function for converting the parsetree of the rule
into a human readable version, pg_get_ruledef(text). You can probably
use the same function for your own purposes.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Y dijo Dios: "Que sea Satanás, para que la gente no me culpe de todo a mí."
"Y que hayan abogados, para que la gente no culpe de todo a Satanás"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-11-26 23:20:10 Request from eWeek for 7.3 comments
Previous Message Ed L. 2002-11-26 21:08:52 how to view original source of rules?