Re: plpgsql_check_function - rebase for 9.3 - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: plpgsql_check_function - rebase for 9.3
Date
Msg-id CAFj8pRAL2s2EkuaW7L-jp24Zowovr9yfm_Dmc3JBBCwouzkETw@mail.gmail.com
Whole thread Raw
In response to Re: plpgsql_check_function - rebase for 9.3  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
<div dir="ltr"><br /><div class="gmail_extra"><br /><br /><div class="gmail_quote">2013/12/9 Peter Eisentraut <span
dir="ltr"><<ahref="mailto:peter_e@gmx.net" target="_blank">peter_e@gmx.net</a>></span><br /><blockquote
class="gmail_quote"style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 12/8/13,
12:01PM, Pavel Stehule wrote:<br /> > But still I have no idea, how to push check without possible slowdown<br />
>execution with code duplication<br /><br /></div>Create a GUC parameter plpgsql.slow_checks or whatever (perhaps
more<br/> specific), which people can turn on when they run their test suites.<br /><br /> This doesn't really have to
beall that much different from what we are<br /> currently doing in C with scan-build and address sanitizer, for
example.<br/><br /></blockquote></div><br /></div><div class="gmail_extra">A main issue is placing these tests on
criticalpath. <br /><br /></div><div class="gmail_extra">You have to check it in every expression, in every internal
switch<br /><br /></div><div class="gmail_extra">There are two main purposes<br /><br /></div><div
class="gmail_extra">a)ensure a expression/query is valid (not only syntax valid)<br /></div><div class="gmail_extra">b)
searchall expressions/queries - visit all possible paths in code.<br /><br /></div><div class="gmail_extra">so you
shouldto place new switch everywhere in plpgsql executor, where is entry to some path.<br /></div><div
class="gmail_extra"><br/></div><div class="gmail_extra">Second issue - these check decrease a readability of plpgsql
statementexecutor handlers. This code is relative very readable now. With new switch is little bit (more) less
clean.<br/><br /></div><div class="gmail_extra">I think so fact we use a two other large statement switch (printing,
freeexpressions) is natural, and it hard to write it better.<br /><br /></div><div class="gmail_extra">Regards<br /><br
/></div><divclass="gmail_extra">Pavel<br /></div></div> 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [patch] Adding EXTRA_REGRESS_OPTS to all pg_regress invocations
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: logical changeset generation v6.7