From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Pascal CROZET <pascal.crozet@metanext.com>
To: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: ERROR: type "my_user_type" does not exist on REFRESH MATERIALIZED VIEW
Date: Fri, 10 Jun 2022 17:57:04 +0200
Message-ID: <ff953d5f710168f2af17d510a847d079e94a98c7.camel@cybertec.at> (raw)
In-Reply-To: <PAXP251MB01782EE9FF9A844E7157F52698A79@PAXP251MB0178.EURP251.PROD.OUTLOOK.COM>
References: <CAH59SE=GKvZxWa++n+D33GV7xk1pyYu=jYzCtsJnXNsdaSSb=w@mail.gmail.com>
<CAKFQuwZoK=gZ_n48djihvgFhgTC4o0Popu--Yak-ntnsTP5DKg@mail.gmail.com>
<PAXP251MB01782EE9FF9A844E7157F52698A79@PAXP251MB0178.EURP251.PROD.OUTLOOK.COM>
On Thu, 2022-06-09 at 19:52 +0000, Pascal CROZET wrote:
> Hi DBA's (PG 12.10 on Ubuntu 20.04)
>
> In a restoration from a full plain text database ( xzcat my_database.sql.xz | psql ), I've this issue at the end.
>
> REFRESH MATERIALIZED VIEW
> ERROR: type "row_reporting_p" does not exist
> LINE 3: _row row_reporting_p;
> ^
> QUERY:
> DECLARE
> _row row_reporting_p;
>
> BEGIN
>
> -- my code
>
> END
>
> CONTEXT: compilation of PL/pgSQL function "get_row_reporting_new" near line 3
> ERROR: type "row_reporting_p" does not exist
> LINE 23: _row row_reporting_p;
>
> Of course, the user type is present and well restored before, 'cause the last SQL commands
> from the file are forREFRESH MATERIALZED VIEW vm_my_materialized_view;
>
> When I refresh the materialized view manually, from psql, the refresh is well.
> This issue is only present on databases using user type. On other databases restoration,
> not using user type, I haven't this isssue.
>
> Is it a PostGreSql bug ? Thanks
I would have to see the dump to be certain, but my guess is that you need to make the function
independent from the current setting of "search_path" by schema-qualifying the data type:
DECLARE
_row my_schema.row_reporting_p;
Yours,
Laurenz Albe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: laurenz.albe@cybertec.at, pascal.crozet@metanext.com
Subject: Re: ERROR: type "my_user_type" does not exist on REFRESH MATERIALIZED VIEW
In-Reply-To: <ff953d5f710168f2af17d510a847d079e94a98c7.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox