Postgres String Length Function In Python