Re: pg_restore depending on user functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Дмитрий Иванов <firstdismay(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: pg_restore depending on user functions
Date: 2021-11-20 20:25:47
Message-ID: 3317884.1637439947@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

=?UTF-8?B?0JTQvNC40YLRgNC40Lkg0JjQstCw0L3QvtCy?= <firstdismay(at)gmail(dot)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

Attachment Content-Type Size
change-dump-priority-of-casts.patch text/x-diff 1.4 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Juan José Santamaría Flecha 2021-11-21 09:43:33 Re: BUG #17288: PSQL bug with COPY command (Windows)
Previous Message Tom Lane 2021-11-20 17:10:21 Re: BUG #17294: spgist doesn't support varchar, only text type fields.

Browse pgsql-general by date

  From Date Subject
Next Message Дмитрий Иванов 2021-11-21 01:11:20 Re: pg_dump insert column GENERATED
Previous Message Adrian Klaver 2021-11-20 19:06:50 Re: pg_dump insert column GENERATED