Re: plpgsql defensive mode

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: plpgsql defensive mode
Дата
Msg-id CAFj8pRB1o819tzEJnCj2Yv=po7dThsvh0pzLn9m=K=sMiSe76Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: plpgsql defensive mode  (Marko Tiikkaja <marko@joh.to>)
Ответы Re: plpgsql defensive mode  (Marko Tiikkaja <marko@joh.to>)
Список pgsql-hackers



2014-09-06 16:31 GMT+02:00 Marko Tiikkaja <marko@joh.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

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: proposal: plpgsql - Assert statement
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: plpgsql defensive mode