Обсуждение: Listing Child Tables of a Particular Parent

Поиск
Список
Период
Сортировка

Listing Child Tables of a Particular Parent

От
"Garcia, Joshua"
Дата:

Hi everyone,

 

I’ve been trying to figure out how to get a list of all the child tables for a particular parent table.  The websites I’ve looked at and the book I have haven’t been able to show me how I can do this.  How can I get such a list? 

 

Thanks in advance,

Josh

Re: Listing Child Tables of a Particular Parent

От
Tom Lane
Дата:
"Garcia, Joshua" <Joshua.Garcia@xerox.com> writes:
> I've been trying to figure out how to get a list of all the child tables
> for a particular parent table.

You'd need to join pg_inherits to pg_class (twice).  See
http://www.postgresql.org/docs/8.1/static/catalogs.html
(adjust link in the obvious way for older PG versions)

            regards, tom lane