[HACKERS] plpgsql: Is ELSE IF supported or not?

2008-06-26 Thread Marko Kreen
Docs seems to say it is, but following function fails to compile: create function err_else() returns void as $$ begin if 1 = 1 then else if 1 = 2 then end if; end; $$ language plpgsql; ERROR: syntax error at or near ; LINE 6: end; Version 8.3.3. -- marko -- Sent via

Re: [HACKERS] plpgsql: Is ELSE IF supported or not?

2008-06-26 Thread Pavel Stehule
hello 2008/6/26 Marko Kreen [EMAIL PROTECTED]: Docs seems to say it is, but following function fails to compile: create function err_else() returns void as $$ begin if 1 = 1 then else if 1 = 2 then end if; end; $$ language plpgsql; ERROR: syntax error at or near ; LINE 6:

Re: [HACKERS] plpgsql: Is ELSE IF supported or not?

2008-06-26 Thread Marko Kreen
On 6/26/08, Pavel Stehule [EMAIL PROTECTED] wrote: 2008/6/26 Marko Kreen [EMAIL PROTECTED]: Docs seems to say it is, but following function fails to compile: create function err_else() returns void as $$ begin if 1 = 1 then else if 1 = 2 then end if; end; $$

Re: [HACKERS] plpgsql: Is ELSE IF supported or not?

2008-06-26 Thread Pavel Stehule
2008/6/26 Marko Kreen [EMAIL PROTECTED]: On 6/26/08, Pavel Stehule [EMAIL PROTECTED] wrote: 2008/6/26 Marko Kreen [EMAIL PROTECTED]: Docs seems to say it is, but following function fails to compile: create function err_else() returns void as $$ begin if 1 = 1 then else if

Re: [HACKERS] plpgsql: Is ELSE IF supported or not?

2008-06-26 Thread Mark Mielke
Pavel Stehule wrote: 2008/6/26 Marko Kreen [EMAIL PROTECTED]: Although now that i read it more, the actual form is: ELSE IF THEN END IF END 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.

Re: [HACKERS] plpgsql: Is ELSE IF supported or not?

2008-06-26 Thread Tom Lane
Mark Mielke [EMAIL PROTECTED] writes: I don't agree with this statement. In all procedural languages, or probably most, they usually make ELSE IF special, in that you don't need to close the block twice as per above. The ELSE IF is not actually special in PL/SQL, so it is not a special