Re: Updating views

From: DaVinci <bombadil(at)wanadoo(dot)es>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Updating views
Date: 2001-06-04 22:10:48
Message-ID: 20010605001048.A2133@lorien.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jun 04, 2001 at 11:12:56PM +0200, Rasmus Resen Amossen wrote:
> If I add a "where" clause on my views, I can't insert or update them
> anymore. Why?
>
> Example:
> CREATE TABLE temp (a int);
> CREATE VIEW tview AS SELECT a FROM temp WHERE a>10;
>
> INSERT INTO tview VALUES (13);
> ERROR: Cannot update a view without an appropriate rule
>
> What is the appropriate rule?

Problem is not 'where'. Views in Postgresql doesn't allows you insert,
update or delete unless you define especila rules that explain Postgresql
what to do in each case.

Look Postgresql programming manual. You can see a few examples of rules in
views.

Greets.

David

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rasmus Resen Amossen 2001-06-04 23:17:00 Re: Updating views
Previous Message Stephan Szabo 2001-06-04 22:00:19 Re: subselects in check clauses