Use SELECT count in IF command

Another pretty usage of SELECT directly in IF:   IF (SELECT count(*) FROM table WHERE column IS NULL)>0 THEN ... END IF

Use EXISTS in IF condition

This is maybe obvious for some experienced PostgreSQL user but people coming from other database may be pleasantly surprised with this construct: IF EXISTS( select ... from table where ....) THEN END IF;...