Re: WIP: Triggers on VIEWs - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: WIP: Triggers on VIEWs
Date
Msg-id 4C9A90B5.4070007@cs.helsinki.fi
Whole thread Raw
In response to Re: WIP: Triggers on VIEWs  (Bernd Helmle <mailings@oopsware.de>)
Responses Re: WIP: Triggers on VIEWs
List pgsql-hackers
On 2010-09-23 1:16 AM, Bernd Helmle wrote:
> INSERT INTO vfoo VALUES('helmle', 2) RETURNING *;
>    text  | id
> --------+----
>   helmle |  2
> (1 row)
>
> SELECT * FROM vfoo;
>   text  | id
> -------+----
>   bernd |  2
> (1 row)
>
> This is solvable by a properly designed trigger function, but maybe we need
> to do something about this?

I really don't think we should limit what people are allowed to do in 
the trigger function.

Besides, even if the RETURNING clause returned 'bernd' in the above 
case, I think it would be even *more* surprising.  The trigger function 
explicitly returns NEW which has 'helmle' as the first field.


Regards,
Marko Tiikkaja


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Why is time with timezone 12 bytes?
Next
From: fazool mein
Date:
Subject: Re: Shutting down server from a backend process, e.g. walrceiver