Re: proposal: plpgsql - Assert statement

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Marko Tiikkaja <marko(at)joh(dot)to>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Petr Jelinek <petr(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: plpgsql - Assert statement
Date: 2015-03-26 05:46:24
Message-ID: CAFj8pRBS3oLwfCGchKWh8foXhozL52qgn3fZLHx+vBd=Ui5p_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2015-03-26 0:08 GMT+01:00 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:

> Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com> writes:
> > On 3/25/15 1:21 AM, Pavel Stehule wrote:
> >> 2015-03-25 0:17 GMT+01:00 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us
> >> <mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us>>:
> >>> (BTW, is considering
> >>> NULL to be a failure the right thing? SQL CHECK conditions consider
> >>> NULL to be allowed ...)
>
> >> This is a question - I am happy with SQL CHECK for data, but I am not
> >> sure if same behave is safe for plpgsql (procedural) assert. More
> >> stricter behave is safer - and some bugs in procedures are based on
> >> unhandled NULLs in variables. So in this topic I prefer implemented
> >> behave. It is some like:
>
> > +1. I think POLA here is that an assert must be true and only true to be
> > valid. If someone was unhappy with that they could always coalesce(...,
> > true).
>
> Fair enough. Committed with the other changes.
>

Thank you very much

regards

Pavel

>
> regards, tom lane
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2015-03-26 05:52:12 compiler warnings in lwlock
Previous Message Michael Paquier 2015-03-26 04:32:31 Re: pg_rewind in contrib