connection = psycopg2.connect(...)
with connection.cursor() as cursor:
cursor.execute('select some_bytea_field from some_table where some_id = ?', (some_id, ))
result = cursor.fetchone()
buf = BytesIO(elem[8])
await bot.send_photo(message.chat.id, buf)
buf = open('путь к файлу какой-нибудь картинки', 'rb')
await bot.send_photo(message.chat.id, buf)