Re: Rules and Views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Curt Sampson <cjs(at)cynic(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Rules and Views
Date: 2002-07-31 03:32:40
Message-ID: 24290.1028086360@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Curt Sampson <cjs(at)cynic(dot)net> writes:
> CREATE VIEW test AS ...
> CREATE RULE test_insert AS
> ON INSERT TO test
> DO ...
> INSERT INTO test VALUES (1, 'one', 'onemore');
> ERROR: Cannot insert into a view without an appropriate rule

> What am I doing wrong here? Is there a bug?

Make that "ON INSERT DO INSTEAD". As coded, the rule leaves the
original insertion into the view still active.

Perhaps the error message could be phrased better --- any thoughts?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-07-31 03:50:38 Open 7.3 items
Previous Message Bruce Momjian 2002-07-31 03:30:16 Re: getpid() function