pl/pgsql oddity - Mailing list pgsql-general

From Joolz
Subject pl/pgsql oddity
Date
Msg-id 35440.10.0.4.254.1103187979.squirrel@webmail.arbodienst-limburg.nl
Whole thread Raw
Responses Re: pl/pgsql oddity
Re: pl/pgsql oddity
Re: pl/pgsql oddity
Re: pl/pgsql oddity
List pgsql-general
Hello everyone,

When writing some serverside code I ran into an oddity that I
managed to boil down to this:

-------------------------------------------------------
create or replace function fubar() returns varchar as '
declare
  l integer;
begin
  l = 38;
  if l < 38 then
    return ''< 38'';
  elseif l >= 38 then
    return ''>= 38'';
  else
    return ''this is not possible'';
  end if;
end;'
language 'plpgsql';
-------------------------------------------------------

But I can't understand or solve it. The function always returns
'this is not possible'. Can someone tell me what I'm overlooking?
Thanks!


pgsql-general by date:

Previous
From: Christopher Browne
Date:
Subject: Re: Aggregates not allowed in WHERE clause?
Next
From: Marco Colombo
Date:
Subject: Re: Scheduler in Postgres