CREATE OR REPLACE FUNCTION is_integer(s TEXT) RETURNS BOOLEAN AS $$
BEGIN
    PERFORM s::INTEGER;
    RETURN true;
EXCEPTION WHEN others THEN
    RETURN false;
END;
$$ LANGUAGE plpgsql;