Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5rpG-0002bu-Ms for pgsql-general@arkaria.postgresql.org; Thu, 15 Dec 2022 17:15:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p5rpF-0000E6-Go for pgsql-general@arkaria.postgresql.org; Thu, 15 Dec 2022 17:15:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5rpF-0000Dl-6W for pgsql-general@lists.postgresql.org; Thu, 15 Dec 2022 17:15:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5rpC-0002nb-W1 for pgsql-general@postgresql.org; Thu, 15 Dec 2022 17:15:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2BFHFDKs3417784; Thu, 15 Dec 2022 12:15:13 -0500 From: Tom Lane To: Michel Pelletier cc: pgsql-general Subject: Re: pg_dumpall renders ALTER TABLE for a view? In-reply-to: References: Comments: In-reply-to Michel Pelletier message dated "Thu, 15 Dec 2022 08:54:05 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3417782.1671124513.1@sss.pgh.pa.us> Date: Thu, 15 Dec 2022 12:15:13 -0500 Message-ID: <3417783.1671124513@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michel Pelletier writes: > 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? We're not likely to change the fact that you're allowed to write ALTER TABLE for this, so if your event triggers get broken by doing that you'd best fix the event triggers. I don't have any great objection to making pg_dump emit the more modern spelling (I think ... you'd need to look into pg_restore to make sure it's not assuming something in this area). But doing that won't really remove the hazard. regards, tom lane