From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Marko Tiikkaja <marko(at)joh(dot)to> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Joel Jacobson <joel(at)trustly(dot)com> |
Subject: | Re: plpgsql defensive mode |
Date: | 2014-09-06 17:50:47 |
Message-ID: | CAFj8pRB1o819tzEJnCj2Yv=po7dThsvh0pzLn9m=K=sMiSe76Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
2014-09-06 16:31 GMT+02:00 Marko Tiikkaja <marko(at)joh(dot)to>:
> 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.
>
you use a normal function. I don't expect, so it can be too often in your
case.
Pavel
>
>
> .marko
>
From | Date | Subject | |
---|---|---|---|
Next Message | Marko Tiikkaja | 2014-09-06 17:54:09 | Re: plpgsql defensive mode |
Previous Message | Pavel Stehule | 2014-09-06 17:49:39 | Re: proposal: plpgsql - Assert statement |