Closed bbsimonbb closed 7 months ago
The 20
is an example of an OID: https://www.postgresql.org/docs/current/datatype-oid.html
The built-in types that come with PostgreSQL have well defined "low" values. Custom types created by end users have higher values and may change across servers as the exact value depends on the order of creation.
There is much that should be improved with this readme:
PRs welcome and if I have some time I'll rewrite it myself. But ultimately the readme is pretty clear that these are OIDs and provides you with SQL commands to see the full set, which will tell you the corresponding number for every type in your database.
Overriding default handling to, say, parse numeric types, is a common thing to want to do, but in the call
types.setTypeParser(20, function(val) { return parseInt(val, 10)})
taken from the readme, how are types identified? 20 represents what? Without this information, I'm helpless?