public inbox for [email protected]  
help / color / mirror / Atom feed
pg_restore and materialized view deps
4+ messages / 2 participants
[nested] [flat]

* pg_restore and materialized view deps
@ 2024-09-07 00:41 Wells Oliver <[email protected]>
  2024-09-07 01:33 ` Re: pg_restore and materialized view deps Tom Lane <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Wells Oliver @ 2024-09-07 00:41 UTC (permalink / raw)
  To: pgsql-admin

Not the end of the world but I notice when running pg_restore that I
encounter a few errors where materialized views cannot be refreshed because
they query other materialized views not yet refreshed.

Is this a fixable thing or just something one must live with, and refresh
them after the restore?

-- 
Wells Oliver
[email protected] <[email protected]>


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pg_restore and materialized view deps
  2024-09-07 00:41 pg_restore and materialized view deps Wells Oliver <[email protected]>
@ 2024-09-07 01:33 ` Tom Lane <[email protected]>
  2024-09-07 01:41   ` Re: pg_restore and materialized view deps Wells Oliver <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2024-09-07 01:33 UTC (permalink / raw)
  To: Wells Oliver <[email protected]>; +Cc: pgsql-admin

Wells Oliver <[email protected]> writes:
> Not the end of the world but I notice when running pg_restore that I
> encounter a few errors where materialized views cannot be refreshed because
> they query other materialized views not yet refreshed.

Oh?  There are dependencies that are supposed to prevent that.
Can you provide a self-contained example of a schema where
that doesn't work?

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pg_restore and materialized view deps
  2024-09-07 00:41 pg_restore and materialized view deps Wells Oliver <[email protected]>
  2024-09-07 01:33 ` Re: pg_restore and materialized view deps Tom Lane <[email protected]>
@ 2024-09-07 01:41   ` Wells Oliver <[email protected]>
  2024-09-07 02:12     ` Re: pg_restore and materialized view deps Tom Lane <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Wells Oliver @ 2024-09-07 01:41 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: pgsql-admin

Ah, you know, a little deeper: it's an issue with a mat view unable to
refresh because it uses a function, and within that function, there is a
call to a mat view not yet materialized.



On Fri, Sep 6, 2024 at 6:33 PM Tom Lane <[email protected]> wrote:

> Wells Oliver <[email protected]> writes:
> > Not the end of the world but I notice when running pg_restore that I
> > encounter a few errors where materialized views cannot be refreshed
> because
> > they query other materialized views not yet refreshed.
>
> Oh?  There are dependencies that are supposed to prevent that.
> Can you provide a self-contained example of a schema where
> that doesn't work?
>
>                         regards, tom lane
>


-- 
Wells Oliver
[email protected] <[email protected]>


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pg_restore and materialized view deps
  2024-09-07 00:41 pg_restore and materialized view deps Wells Oliver <[email protected]>
  2024-09-07 01:33 ` Re: pg_restore and materialized view deps Tom Lane <[email protected]>
  2024-09-07 01:41   ` Re: pg_restore and materialized view deps Wells Oliver <[email protected]>
@ 2024-09-07 02:12     ` Tom Lane <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2024-09-07 02:12 UTC (permalink / raw)
  To: Wells Oliver <[email protected]>; +Cc: pgsql-admin

Wells Oliver <[email protected]> writes:
> Ah, you know, a little deeper: it's an issue with a mat view unable to
> refresh because it uses a function, and within that function, there is a
> call to a mat view not yet materialized.

Oh yes, pg_dump can't really see dependencies inside function bodies.

... Unless ... can you write the function as a new-style SQL
function (BEGIN ATOMIC instead of a string literal)?
Then I think it might work.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2024-09-07 02:12 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-09-07 00:41 pg_restore and materialized view deps Wells Oliver <[email protected]>
2024-09-07 01:33 ` Tom Lane <[email protected]>
2024-09-07 01:41   ` Wells Oliver <[email protected]>
2024-09-07 02:12     ` Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox