Re: plpgsql: Is ELSE IF supported or not? - Mailing list pgsql-hackers

From Mark Mielke
Subject Re: plpgsql: Is ELSE IF supported or not?
Date
Msg-id 4863A901.2060707@mark.mielke.cc
Whole thread Raw
In response to Re: plpgsql: Is ELSE IF supported or not?  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Responses Re: plpgsql: Is ELSE IF supported or not?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Pavel Stehule wrote: <blockquote cite="mid:162867790806260432o74515e8fwfc8958adccfce6e2@mail.gmail.com"
type="cite"><prewrap="">2008/6/26 Marko Kreen <a class="moz-txt-link-rfc2396E"
href="mailto:markokr@gmail.com"><markokr@gmail.com></a>:</pre><blockquote type="cite"><pre wrap="">
 
Although now that i read it more, the actual "form" is:
ELSE   IF THEN   END IFEND IF;

That is - the ELSE starts new block unconditionally and ignores any IF
that follows.  Later the IF can be part of new block as usual.  Huh.

This is confusing.  I suggest removing the "ELSE IF" as one of the "forms"
because it is not.   </pre></blockquote><pre wrap="">
this is same in all procedural languages </pre></blockquote><br /> I don't agree with this statement. In "all
procedurallanguages", or probably most, they usually make "ELSE IF" special, in that you don't need to close the block
twiceas per above. The ELSE IF is not actually special in PL/SQL, so it is not a special form. The "ELSE" can contain a
block,which contain any statement, including a nested IF statement. Why not describe ELSE WHILE as well based upon the
logicthat ELSE IF is valid? :-)<br /><br /> Now, if it were to say "an alternative form of ELSEIF is to nest IF
statementlike so:" ...<br /><br /> Cheers,<br /> mark<br /><br /><pre class="moz-signature" cols="72">-- 
 
Mark Mielke <a class="moz-txt-link-rfc2396E" href="mailto:mark@mielke.cc"><mark@mielke.cc></a>
</pre>

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: get_relation_stats_hook()
Next
From: Josh Berkus
Date:
Subject: Re: [0/4] Proposal of SE-PostgreSQL patches