PostgreSQL, если еще endif
if condition then
statements;
else
alternative-statements;
END if;
The Rambling Lank
if condition then
statements;
else
alternative-statements;
END if;