Re: proposal: plpgsql - Assert statement - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: proposal: plpgsql - Assert statement
Date
Msg-id 5419D945.3000400@gmx.net
Whole thread Raw
In response to Re: proposal: plpgsql - Assert statement  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On 9/16/14 12:01 AM, Alvaro Herrera wrote:
> Jan Wieck wrote:
>> I think that most data integrity issues can be handled by a well
>> designed database schema that uses UNIQUE, NOT NULL, REFERENCES and
>> CHECK constraints. Assertions are usually found inside of complex
>> code constructs to check values of local variables. I don't think it
>> is even a good idea to implement assertions that can query arbitrary
>> data.
> 
> Actually Peter Eisentraut posted a patch for SQL assertions:
> http://www.postgresql.org/message-id/1384486216.5008.17.camel@vanquo.pezone.net

SQL assertions are just a kind of CHECK constraint, so fully
Jan-compliant. ;-)

I don't mind PL/pgSQL having an "assert" statement like many programming
languages, but I find a lot of the proposed details dubious.



pgsql-hackers by date:

Previous
From: Emanuel Calvo
Date:
Subject: Re: Turning off HOT/Cleanup sometimes
Next
From: Peter Eisentraut
Date:
Subject: Re: proposal: plpgsql - Assert statement