Re: pl/pgsql oddity
От | Richard Huxton |
---|---|
Тема | Re: pl/pgsql oddity |
Дата | |
Msg-id | 41C156DF.6090704@archonet.com обсуждение исходный текст |
Ответ на | pl/pgsql oddity ("Joolz" <joolz@arbodienst-limburg.nl>) |
Ответы |
Re: pl/pgsql oddity
Re: pl/pgsql oddity |
Список | pgsql-general |
Joolz wrote: > Hello everyone, > > When writing some serverside code I ran into an oddity that I > managed to boil down to this: > elseif l >= 38 then You want "elsif" - plpgsql isn't a hugely sophisticated language and its parser is having trouble there. I'm guessing the parser is somehow putting the "elseif" branch under the initial "then" so it never gets executed. If you rewrite the function like so: create or replace function fubar() returns varchar as ' declare l integer; begin l = 34; if l < 38 then raise notice ''< 38: %'',l; elseif l >= 38 then raise notice ''>= 38: %'',l; else raise notice ''this is not possible: %'',l; end if; return 0; end;' language 'plpgsql'; Now, try different values for "l" and you'll see what is happening. Congratulations - I think you've found a bug. You can report it formally via the bugs mailing list or http://www.postgresql.org/bugform.html -- Richard Huxton Archonet Ltd
В списке pgsql-general по дате отправления: