Re: pg_restore depending on user functions

Дмитрий Иванов <firstdismay@gmail.com>

From: Дмитрий Иванов <firstdismay@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2021-11-21T15:30:16Z
Lists: pgsql-bugs, pgsql-general
Ok.
I have a very general idea of how to do it. I'm afraid I won't be able to
do it immediately, I'm looking into it. But when there is an update I will
definitely check and let you know.

вс, 21 нояб. 2021 г. в 01:25, Tom Lane <tgl@sss.pgh.pa.us>:

> =?UTF-8?B?0JTQvNC40YLRgNC40Lkg0JjQstCw0L3QvtCy?= <firstdismay@gmail.com>
> writes:
> > I hope this helps you.
>
> Okay, that's better.
>
> The problem seems to be that the view using the cast is itself depended
> on (indirectly through another view) by another function a_ext_by_id(),
> which is using the intermediate view's rowtype as its output type.
> So that causes the dependency sort to hoist those two views above the
> function a_ext_by_id(), and now they're ahead of the cast, which is
> just left at its initial priority-driven location.
>
> I think we can fix this by adjusting the sort priority order as per
> the attached patch.  This fixes this toy test case anyway.  Can you
> check to see if it fixes your real database?
>
> (Note that as given, the patch will only apply to v14 not earlier
> branches.)
>
>                         regards, tom lane
>
>

Commits

  1. Adjust pg_dump's priority ordering for casts.