Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

BUG #1329: Bug in IF-ELSEIF-ELSE construct



The following bug has been logged online:

Bug reference:      1329
Logged by:          Rico Wind

Email address:      rw(at)rico-wind(dot)dk

PostgreSQL version: 8.0 Beta

Operating system:   Windows XP, SP2

Description:        Bug in IF-ELSEIF-ELSE construct

Details: 

Beta 1.
The following always returns 4:

IF from_date_param=period_begin AND until_date_param=period_end 
THEN
	return 1;
ELSEIF from_date_param=period_begin
THEN
	return 2;
ELSEIF until_date_param=period_end
THEN
	return 3;
ELSE
	return 4;
END IF;

Whereas the following returns the right answer(not 4 each time). They should 
be the same. 
IF from_date_param=period_begin AND until_date_param=period_end
THEN
	return 1;
ELSE
	IF from_date_param = period_begin
	THEN
		return 2;
	END IF;
	
	IF until_date_param=period_end
	THEN
		return 3;
	END IF;
END IF;
RETURN 4;




Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group