ERROR: negative substring length not allowed

PostgreSQL negative substring length not allowed

Wrong select

select substring('abc', 1,-1);
ERROR: negative substring length not allowed

Correct select

select substring('abc', 1, 1);
Data Output: a

select substring('abc', 1, 2);
Data Output: ab