Error with None/NULL Parameters While Converting the Document Management Application to PostgreSQL

Thank you for your help. I don't understand what the exatctly issue is but this work.

SELECT COUNT(*)
FROM document_folders f
WHERE 
    f.parentid IS NOT DISTINCT FROM :parentId::INTEGER
    AND f.name = :name