postgresql: Rename db_to_revision to db_to_optional_revision, and add db_to_revision
which crashes instead.
db_to_revision should be used to convert when selecting directly from tables, and db_to_optional_revision when doing an outer join with the table.
This allows skipping 'assert revision is not None' just to make mypy happy, which I would need to add while implementing #4672 (closed)