Dependency tree to tie type/function deps to a table

Поиск
Список
Период
Сортировка
От Jeremy Finzel
Тема Dependency tree to tie type/function deps to a table
Дата
Msg-id CAMa1XUj6FBQ2USDa53TKquHAjRZwSrTwNDSnaTm=11wjdq4Nsg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Dependency tree to tie type/function deps to a table  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
It looks like the very useful dependency tree shown when using DROP CASCADE is written in C in dependency.c, but there is no way to leverage this within Postgres to actually query an object's dependencies.  Can we get this somehow as a Postgres client in SQL?

One of the problems we face over and over is that we want precisely this list of dependencies, for example so that we can recreate a base table with all of the dependencies on top of it.

The pg_depend_display is not perfect for example to tie together functions that have table dependencies.  Currently, if I have a function foo() that returns type setof foo where foo is a foreign table, the pg_depend_display functions shows no connection between the function foo()  and the type foo to the table foo.

Is there any way we can get that dependency.c code in a consumable form inside postgres, for example as an ordered JSON list of objects as dependencies to be recreated that could be passed to pg_dump in order to recreate the objects in order after recreating a table?

Really appreciate any feedback.

Thanks!
Jeremy

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

Предыдущее
От: Yogesh Sharma
Дата:
Сообщение: Re: Size of pg_multixact/members increases 11355
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Size of pg_multixact/members increases 11355