Re: BUG #16202: Cannot restore database that has materialized view using crosstab (tablefunc)

From: Wagner Engel <wagner(dot)engel(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16202: Cannot restore database that has materialized view using crosstab (tablefunc)
Date: 2020-01-10 18:30:42
Message-ID: CANV-=J=1zv7cyZU=OcUpb6vCQWTTRJjy6MA6MgvpO-d1cEqAtg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Indeed, that was it. Thank you so much!

Em sex., 10 de jan. de 2020 às 15:04, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> escreveu:

> PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> > If I build a materizalized view that uses the crosstab() function, a
> > dump/restore cycle will not restore the database.
>
> > CREATE VIEW v AS
> > SELECT * FROM crosstab (
> > 'SELECT id FROM t as t1',
> > 'SELECT id FROM t as t2'
> > ) ct (a integer, b integer);
>
> This view is unsafe because it doesn't schema-qualify its reference
> to table t. It will fail if run with a restrictive search_path,
> which is what pg_dump does for security reasons.
>
> An ordinary view reference to "t" would be all right, because the
> system understands what that is and can adjust the schema qualification;
> but here you've just got a string that happens to contain "t" in it.
>
> regards, tom lane
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-01-10 19:38:21 BUG #16203: So difficult to set an use postgres
Previous Message Tom Lane 2020-01-10 18:04:05 Re: BUG #16202: Cannot restore database that has materialized view using crosstab (tablefunc)