Re: How to see a RULE definition? - Mailing list pgsql-general

From Jan Wieck
Subject Re: How to see a RULE definition?
Date
Msg-id 200101112017.PAA04975@jupiter.jw.home
Whole thread Raw
In response to Re: How to see a RULE definition?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> Josh Goodman <jogoodma@lanl.gov> writes:
> > ...  I was able to figure out that all the rules
> > for a particular DB are stored in the pg_rewrite table but that seems
> > almost unreadable for a human.  What I would like is a command that spits
> > out the create syntax I used when the rule was first created.
>
> See the (woefully undocumented) pg_get_ruledef() function.  pg_dump uses
> this.

    Or just

        SELECT * FROM pg_rules;

> A join of pg_rewrite against pg_class should do it for you ...

    The  above  *IS*  the  join  against these two. And there are
    pg_tables and pg_views as well.


Jan :-)

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



pgsql-general by date:

Previous
From: Jan Wieck
Date:
Subject: Re: How to tell if that UPDATE worked?
Next
From: Jan Wieck
Date:
Subject: Re: How to see a RULE definition?