Fetch all (remaining) rows of a query result, returning
them as a sequence of sequences (e.g. a list of tuples).
Note that the cursor's arraysize attribute can affect the
performance of this operation.

since fetchall() returns a list of tuples, then result[0] is a tuple with one entry for each field in the table returned by the query. In your case there is only one field, but it is still a tuple so you have to index it again to get the field value out of it.