pg_dumpall renders ALTER TABLE for a view?

From: Michel Pelletier <pelletier(dot)michel(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: pg_dumpall renders ALTER TABLE for a view?
Date: 2022-12-15 16:54:05
Message-ID: CACxu=vKVUTuPAy3qv5FPNr=zTdcJqZbzP7_9euJx4Owi_LMNrg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

We found the root cause for an issue we encountered restoring a saved
database stored with pg_dumpall, but during this investigation we realized
that pg_dump/all renders `ALTER TABLE` statements for views, for example to
convey ownership.

I get that this is synonymous in most cases, except when there is an event
trigger for `ALTER TABLE`, it ends up firing the event trigger for the
views, and any event triggers expected to fire on `ALTER VIEW` statements
do not fire.

Is this something we can contribute a fix for, or is this some kind of
necessary b/w compat issue that must remain? Looking at the history of
ALTER VIEW it looks like it has existed since at least 9.0, so it seems
safe to me from a b/w compat standpoint to render the correct statement.

Thanks!

-Michel

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2022-12-15 17:15:13 Re: pg_dumpall renders ALTER TABLE for a view?
Previous Message vignesh C 2022-12-15 16:24:44 Re: Support logical replication of DDLs