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

From Jan Wieck
Subject Re: proposal: plpgsql - Assert statement
Date
Msg-id 5415E33C.4030003@wi3ck.info
Whole thread Raw
In response to Re: proposal: plpgsql - Assert statement  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: proposal: plpgsql - Assert statement
Re: proposal: plpgsql - Assert statement
List pgsql-hackers
On 09/14/2014 02:25 PM, Pavel Stehule wrote:
> a) Isn't possible handle a assertion exception anywhere .. it enforce
> ROLLBACK in 100%
>
> b) Assertions should be disabled globally .. I am not sure, it it is a
> good idea, but I can understand so some tests based on queries to data
> can be performance issue.
>
> Important question is a relation assertations and exceptions. Is it only
> shortcut for exception or some different?

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.


Jan

-- 
Jan Wieck
Senior Software Engineer
http://slony.info



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: plpgsql - Assert statement
Next
From: Alexander Korotkov
Date:
Subject: Re: KNN-GiST with recheck