Re: Deleting From View? - Mailing list pgsql-general

From Andreas Kretschmer
Subject Re: Deleting From View?
Date
Msg-id 20070105155108.GA22220@KanotixBox
Whole thread Raw
In response to Re: Deleting From View?  ("Jeanna Geier" <jgeier@apt-cafm.com>)
List pgsql-general
Jeanna Geier <jgeier@apt-cafm.com> schrieb:

>
> Hello List!
>
> I'm having an issue with my program; it's inserting into one record into a
> view (named 'measurement') twice ,which it's not supposed to be - so, I'm

You can't insert data into a view. My guess: you have a RULE for this
VIEW to handle INSERTs.


> attempting to put a delete statement in the code to remove one of these
> records, but am getting an error.  (Will track down the real insert issue
> ...
> And when I run my program I get an exception: cannot delete from a view.
>
> Is there anyway I can do this in my code?

You need a RULE for DELETE, too. Take a look at
http://www.postgresql.org/docs/8.1/interactive/rules-update.html


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Deleting From View?
Next
From: "Jeanna Geier"
Date:
Subject: Re: Deleting From View?