Postgres Get Length Of String Python Replace Part