crosstab documentation should add a note about use in materialized views

Started by PG Bug reporting formover 3 years ago3 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/15/tablefunc.html
Description:

When using a crosstab in a materialized view, if the SQL is not qualified
with a schema, that restoring a database from a dump may fail. See the
discussion in
/messages/by-id/16202-b6b345c9d2819409@postgresql.org

#2Bruce Momjian
bruce@momjian.us
In reply to: PG Bug reporting form (#1)
Re: crosstab documentation should add a note about use in materialized views

On Tue, Oct 18, 2022 at 08:30:13AM +0000, PG Doc comments form wrote:

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/15/tablefunc.html
Description:

When using a crosstab in a materialized view, if the SQL is not qualified
with a schema, that restoring a database from a dump may fail. See the
discussion in
/messages/by-id/16202-b6b345c9d2819409@postgresql.org

I am trying to understand the scope of this breakage. I think it is
because crosstab specifies queries as strings, and a materialized view
has to run the query during restore to populate the materialized view.
Is this the only combination of pg_dump restore breakage?

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

Indecision is a decision. Inaction is an action. Mark Batterson

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: crosstab documentation should add a note about use in materialized views

Bruce Momjian <bruce@momjian.us> writes:

When using a crosstab in a materialized view, if the SQL is not qualified
with a schema, that restoring a database from a dump may fail. See the
discussion in
/messages/by-id/16202-b6b345c9d2819409@postgresql.org

I am trying to understand the scope of this breakage. I think it is
because crosstab specifies queries as strings, and a materialized view
has to run the query during restore to populate the materialized view.
Is this the only combination of pg_dump restore breakage?

It doesn't sound like this is in any way unique to crosstab.
Any underqualified reference to a user-defined object can cause
problems during dump/restore, because of the restricted search_path
we use during restore.

regards, tom lane