http://www.postgresql.org/docs/9.4/static/functions-string.h...
select(from('tab'), where(and(like('name','Mo%'),not(is('id',NULL)))
EXECUTE format('SELECT * FROM tab %s', format('WHERE %I IS NOT NULL', 'id'));
http://www.postgresql.org/docs/9.4/static/functions-string.h...