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

From Pavel Stehule
Subject Re: proposal: plpgsql - Assert statement
Date
Msg-id CAFj8pRC--EZp9sNcGFeV2ZnLVr8k1jmWen=Q7xY4yw78LUjPWQ@mail.gmail.com
Whole thread Raw
In response to Re: proposal: plpgsql - Assert statement  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers


2014-09-17 21:36 GMT+02:00 Peter Eisentraut <peter_e@gmx.net>:
On 9/17/14 3:04 PM, Pavel Stehule wrote:
> What is difference between content of variable or content of database?
> You can test any prerequisite, but when this prerequisite is not solved,
> than exception is very very hard without possible handling.

If the assertion tests arbitrary Boolean expressions, then we can't stop
the user from abusing them.


I am thinking so unhandled signal can be good defence. (and possibility to disable assertions)

We design a database system, so we should to reflect it - plpgsql (or any PL environment) are not classic language. There are lot of database specific constructs.
 
But it's another thing if we design specific syntax that encourages such
abuse, as proposed earlier.


Other note - I am thinking so ANSI SQL Assertions and PL assertions are independent features. Although they can have some common goals.

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Turning off HOT/Cleanup sometimes
Next
From: Vik Fearing
Date:
Subject: Re: Anonymous code block with parameters