I would like to cast a value to a type using not the type name, but the OID of the type. Is this possible? So instead of:
SELECT '{{a}}'::char[]
do
SELECT '{{a}}'::1002
(although the above results in a syntax error)
Context: I'm writing a library in Python to query PostgreSQL, which includes conversions from PostgreSQL types to Python types, and I want to make sure I test all the types, and it seems easiest to go through all the OIDs listed at https://github.com/postgres/postgres/blob/master/src/include/catalog/pg_type.dat