select --id, language, source_id, date_part('epoch', pubDate) AS date, length(text) AS text, coalesce(length(title), 0) AS title, least(coalesce(length(sentences), 0), 1)=1 AS sentences, -- True for NOT NULL least(coalesce(length(termvector), 0), 1)=1 AS termvector, -- True for NOT NULL coalesce(_calaised, False) AS calaised, coalesce(_analyzed, False) AS analyzed from documents order by (pubdate) desc limit 10000;