Thread: About copy to view

About copy to view

From
Jinhua Luo
Date:
Hi,

Why view needs instead of trigger to be the target of "copy to"?
With default view rule, the insert would be successful, so it should
also works for copy.

The reason to ask this question is I need to "copy to" the view using
"replica" session role. But instead of trigger on view could not be
set to "enable always" or "enable replica", because "alter table"
would error it's not a base table, e.g.

tmp=# alter table foobar2_view enable always trigger foobar2_view_trigger;
ERROR:  "foobar2_view" is not a table or foreign table

Help please, thanks.

Regards,
Jinhua Luo