several reports of users being confused when they attempt to use ELSEIF
and run into trouble due to PL/PgSQL's lax parser. The parser will be
improved for 8.1, but we can fix most of the problem by allowing ELSEIF
for now.
<para>
<literal>IF</> statements let you execute commands based on
- certain conditions. <application>PL/pgSQL</> has four forms of
+ certain conditions. <application>PL/pgSQL</> has five forms of
<literal>IF</>:
<itemizedlist>
<listitem>
<listitem>
<para><literal>IF ... THEN ... ELSIF ... THEN ... ELSE</></>
</listitem>
+ <listitem>
+ <para><literal>IF ... THEN ... ELSEIF ... THEN ... ELSE</></>
+ </listitem>
</itemizedlist>
</para>
</programlisting>
</para>
</sect3>
+
+ <sect3>
+ <title><literal>IF-THEN-ELSEIF-ELSE</></title>
+
+ <para>
+ <literal>ELSEIF</> is an alias for <literal>ELSIF</>.
+ </para>
</sect2>
<sect2 id="plpgsql-control-structures-loops">
default { return K_DEFAULT; }
diagnostics { return K_DIAGNOSTICS; }
else { return K_ELSE; }
+elseif { return K_ELSIF; }
elsif { return K_ELSIF; }
end { return K_END; }
exception { return K_EXCEPTION; }