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.
> On that
> same line of thinking, is there a command to get a list of all rules that
> have been put on a table?
A join of pg_rewrite against pg_class should do it for you ...
regards, tom lane