Hello since BOOL expression has three possible values: TRUE,FALSE,NULL plpgsql IF control structure should have three alternate blocks: THEN,ELSE,NULL
shouldn't it ? ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html