Re: proposal: plpgsql - Assert statement

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jan Wieck <jan(at)wi3ck(dot)info>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: Marko Tiikkaja <marko(at)joh(dot)to>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: plpgsql - Assert statement
Date: 2014-09-17 19:00:33
Message-ID: 5419DA51.3080308@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9/14/14 2:49 PM, Jan Wieck wrote:
> I don't think it is even a good idea to implement assertions that can
> query arbitrary data.

In a normal programming language, an assertion is usually a static fault
in your program. If the assertion ever fails, you fix your program and
then it hopefully never happens again.

Assertion that query the state of the database or result row counts are
pushing that concept quite a bit. Those are not assertions, those are
just plain old error handling.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2014-09-17 19:04:53 Re: proposal: plpgsql - Assert statement
Previous Message Peter Eisentraut 2014-09-17 18:56:05 Re: proposal: plpgsql - Assert statement