views:

26

answers:

2

Hi all,

I am using PostgreSQL to store business data in large amount for data warehousing purpose. I am writing views to customize the materialized tables.

I am wondering whether it is possible to set a view not updatable.

I have checked the postgresql manual, but found no specific answer.

Many thanks in advance.

A: 

Views in PostreSQL aren't updatable.

Tometzky
A: 

PostgreSQL doesn't have updatable views, you have to create RULE's to make this possible. Without these extra rules, you can't do an update on a view.

From the manual:

What happens if a view is named as the target relation for an INSERT, UPDATE, or DELETE? After doing the substitutions described above, we will have a query tree in which the result relation points at a subquery range-table entry. This will not work, so the rewriter throws an error if it sees it has produced such a thing.

Frank Heikens
Thanks, How foolish I am!
Chris Chou