In PostgreSQL, the pg_typeof()
function allows you to get the data type of any value.
More specifically, it returns the OID of the data type of the value that is passed to it. It returns a regtype
, which is an OID alias type. Therefore it’s the same as an OID for comparison purposes but displays as a type name.