Re: PL/pgSQL 1.2 - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: PL/pgSQL 1.2
Date
Msg-id 540B4737.4080108@joh.to
Whole thread Raw
In response to Re: PL/pgSQL 1.2  (Oskari Saarenmaa <os@ohmu.fi>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Oskari Saarenmaa
Date:
Subject: Re: PL/pgSQL 1.2
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: plpgsql - Assert statement