Re: plpgsql defensive mode

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: plpgsql defensive mode
Дата
Msg-id 540B1ADD.106@joh.to
обсуждение исходный текст
Ответ на plpgsql defensive mode  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: plpgsql defensive mode  (Joel Jacobson <joel@trustly.com>)
Re: plpgsql defensive mode  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: plpgsql defensive mode  (Joel Jacobson <joel@trustly.com>)
Список 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 по дате отправления:

Предыдущее
От: Joel Jacobson
Дата:
Сообщение: Re: plpgsql defensive mode
Следующее
От: Joel Jacobson
Дата:
Сообщение: Re: plpgsql defensive mode