Re: How to see a RULE definition?

From: Jan Wieck <janwieck(at)Yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Josh Goodman <jogoodma(at)lanl(dot)gov>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to see a RULE definition?
Date: 2001-01-11 20:17:47
Message-ID: 200101112017.PAA04975@jupiter.jw.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Josh Goodman <jogoodma(at)lanl(dot)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(at)Yahoo(dot)com #

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2001-01-11 20:19:32 Re: How to see a RULE definition?
Previous Message Dan Moschuk 2001-01-11 20:11:07 exit status 26