About copy to view - Mailing list pgsql-hackers

From Jinhua Luo
Subject About copy to view
Date
Msg-id CAAc9rOzpzgB6kCZFgjE441KHT=LkqzEGsbo2xhqtr5CFr-igGg@mail.gmail.com
Whole thread Raw
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: "Leif Gunnar Erlandsen"
Date:
Subject: pause recovery if pitr target not reached
Next
From: Ashutosh Sharma
Date:
Subject: Re: Support for CALL statement in ecpg