Update command on view returns tuples

From: Han Holl <han(dot)holl(at)prismant(dot)nl>
To: pgsql-general(at)postgresql(dot)org
Subject: Update command on view returns tuples
Date: 2002-12-11 10:23:58
Message-ID: 200212111123.58823.han.holl@prismant.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hello,

If I do:
UPDATE table SET column = 'value' where column = 'othervalue';
in psql, I get something like
UPDATE 14.

But if 'table' is in fact a view, and I do the update via the rule:
CREATE RULE somerule AS ON UPDATE TO table DO INSTEAD select
somefunction(...);
I get 14 tuples back with the result of each somefuntion().
Defining somefunction() to return void doesn't help, I get 14 tuples
with null.

Is there a workaround for this behaviour? Shouldn't it be transparant
for a client whether an UPDATE is on a table or on a view ?

Cheers,

Han Holl

Browse pgsql-general by date

  From Date Subject
Next Message Han Holl 2002-12-11 10:41:27 Re: Postgresql and Ruby - any opensource software done with these two ?
Previous Message Bret Hughes 2002-12-11 09:39:40 Re: postponing index updates in a transaction