Re: plpgsql_check_function - rebase for 9.3

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: plpgsql_check_function - rebase for 9.3
Дата
Msg-id 4048.1386738638@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: plpgsql_check_function - rebase for 9.3  (Amit Kapila <amit.kapila16@gmail.com>)
Ответы Re: plpgsql_check_function - rebase for 9.3
Список pgsql-hackers
Amit Kapila <amit.kapila16@gmail.com> writes:
> On Tue, Dec 10, 2013 at 12:15 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>> Now, PG has no any tool for checking dependency between functions and other
>> objects.

> Isn't that already done for SQL function's (fmgr_sql_validator)?

Pavel's point is that the only way to find out if the validator will fail
is to run it and see if it fails; and even if it does, how much will you
know about why?  That's not particularly helpful for pg_dump, which needs
to understand dependencies in a fairly deep fashion.  It not only needs to
figure out how to dump the database objects in a dependency-safe order,
but what to do to break dependency loops.

Right now I believe that pg_dump has a workable strategy for every
possible case of circular dependencies, because they are all caused by
secondary attributes of objects that can be split out and applied later,
for example applying a column default via ALTER TABLE ALTER COLUMN SET
DEFAULT rather than listing the default right in the CREATE TABLE command.

However, if function A depends on B and also vice-versa (mutual recursion
is not exactly an unheard-of technique), there is no way to load them both
if the function bodies are both checked at creation time.

I guess we could invent some equivalent of a forward declaration, but
that still leaves us short of understanding what the function body is
depending on.
        regards, tom lane



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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: -d option for pg_isready is broken
Следующее
От: Rajeev rastogi
Дата:
Сообщение: Re: COPY table FROM STDIN doesn't show count tag