Re: pg_restore depending on user functions - Mailing list pgsql-bugs

From Дмитрий Иванов
Subject Re: pg_restore depending on user functions
Date
Msg-id CAPL5KHpT1q55mbYG_Zp1HoLvC=4QxNA8LY-dB6adPK7QiFs+yQ@mail.gmail.com
Whole thread Raw
In response to Re: pg_restore depending on user functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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>:
Дмитрий Иванов <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

pgsql-bugs by date:

Previous
From: Juan José Santamaría Flecha
Date:
Subject: Re: BUG #17288: PSQL bug with COPY command (Windows)
Next
From: Tomas Vondra
Date:
Subject: Re: BUG #17295: Different query plan with Index Only Scan and Bitmap Index Scan.