Re: How to see a RULE definition?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to see a RULE definition?
Дата
Msg-id 11755.979232278@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How to see a RULE definition?  (Josh Goodman <jogoodma@lanl.gov>)
Ответы Re: How to see a RULE definition?
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: "Trewern, Ben"
Дата:
Сообщение: RE: How to see a RULE definition?
Следующее
От: "Trewern, Ben"
Дата:
Сообщение: Recall: How to see a RULE definition?