On Wed, Dec 15, 2021 at 1:05 AM Alvaro Herrera <alvhe...@alvh.no-ip.org> wrote: > > On 2021-Dec-14, Tomas Vondra wrote: > > > Yeah. I think it's not clear if this should behave more like an index or a > > view. When an indexed column gets dropped we simply drop the index. But if > > you drop a column referenced by a view, we fail with an error. I think we > > should handle this more like a view, because publications are externally > > visible objects too (while indexes are pretty much just an implementation > > detail). > > I agree -- I think it's more like a view than like an index. (The > original proposal was that if you dropped a column that was part of the > column list of a relation in a publication, the entire relation is > dropped from the view, >
I think in the above sentence, you mean to say "dropped from the publication". So, IIUC, you are proposing that if one drops a column that was part of the column list of a relation in a publication, an error will be raised. Also, if the user specifies CASCADE in Alter Table ... Drop Column, then we drop the relation from publication. Is that right? BTW, this is somewhat on the lines of what row_filter patch is also doing where if the user drops the column that was part of row_filter for a relation in publication, we give an error and if the user tries to drop the column with CASCADE then the relation is removed from the publication. -- With Regards, Amit Kapila.