Cast char as integer
postgres=# postgres=# postgres=# SELECT 1 + CAST('1' || '2' AS integer) AS add_on_to_twelve; add_on_to_twelve ------------------ 13 (1 row) postgres=#