## 52.83. `pg_rules`

[]()

 The view `pg_rules` provides access to useful information about query rewrite rules.

**Table 52.84. `pg_rules` Columns**

|                                                Column Type<br/><br/> Description                                               |
|--------------------------------------------------------------------------------------------------------------------------------|
|`schemaname` `name` (references [`pg_namespace`](catalog-pg-namespace.html).`nspname`)<br/><br/> Name of schema containing table|
|     `tablename` `name` (references [`pg_class`](catalog-pg-class.html).`relname`)<br/><br/> Name of table the rule is for      |
|            `rulename` `name` (references [`pg_rewrite`](catalog-pg-rewrite.html).`rulename`)<br/><br/> Name of rule            |
|                        `definition` `text`<br/><br/> Rule definition (a reconstructed creation command)                        |

 The `pg_rules` view excludes the `ON SELECT` rules of views and materialized views; those can be seen in [`pg_views`](view-pg-views.html) and [`pg_matviews`](view-pg-matviews.html).

