Re: WIP: Triggers on VIEWs

From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Bernd Helmle <mailings(at)oopsware(dot)de>
Cc: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WIP: Triggers on VIEWs
Date: 2010-09-22 23:26:45
Message-ID: 4C9A90B5.4070007@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message fazool mein 2010-09-22 23:28:30 Re: Shutting down server from a backend process, e.g. walrceiver
Previous Message Josh Berkus 2010-09-22 23:20:49 Re: Why is time with timezone 12 bytes?