Re: plpgsql defensive mode - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: plpgsql defensive mode
Date
Msg-id 540B1ADD.106@joh.to
Whole thread Raw
In response to plpgsql defensive mode  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: plpgsql defensive mode
Re: plpgsql defensive mode
Re: plpgsql defensive mode
List pgsql-hackers
On 2014-09-06 7:51 AM, Pavel Stehule wrote:
> In this mode .. all DML statements should to return EXACTLY ONE row with
> exception CURSORs and FOR LOOP cycle where more rows is expected. But in
> this case we can raise a exception NODATA if there is no row.
>
> In this mode late IO casting will be disabled. We can disallow implicit
> casting too.
>
> We can talk what plpgsql warnings in this mode will be critical.
>
> This mode can be enabled for function by option
>
> #option defensive
>
> or for all plpgsql functions by GUC
>
> SET plpgsql.defensive = on
>
> In this moment I don't see a necessity to change or enhance syntax.

How do you run queries which affect more than one row in this mode? 
Because that's crucial as well.  We want something we can run 100% of 
our code on, but with a slightly more convenient syntax than PL/PgSQL 
provides right when coding defensively in the cases where exactly one 
row should be affected.


.marko



pgsql-hackers by date:

Previous
From: Joel Jacobson
Date:
Subject: Re: plpgsql defensive mode
Next
From: Joel Jacobson
Date:
Subject: Re: plpgsql defensive mode