On 2014-09-06 7:34 PM, Oskari Saarenmaa wrote:
> Anyway, I think the discussed feature to make select, update and delete
> throw an error if they returned or modified <> 1 row would be more
> useful as an extension of the basic sql statements instead of a plpgsql
> (2) only feature to make it possible to use it from other languages and
> outside functions.
I can't really say I object to this, but doing it in the PL allows the
parameters to be printed as well, akin to the
plpgsql.print_strict_params setting added in 9.4. Though I wonder if
that would still be possible if PL/PgSQL peeked inside the parse tree a
bit to pull out these constraints or something *waves hands*. Or
perhaps there's a better way to attach a helpful DETAIL line to the error.
.marko