Is there a practical limit on the number of PostgreSQL TYPES? We are using Postgresql 9.6  in an application where we are considering using the TYPES system to extend new object types 

The system would start with 10-20 types and then users would have a UI to create new types, probably composite types.

Question - is there a practical limitation on the number of TYPES?  

From a system design alternative perspective we could use MongoDB and JavaScript objects which would give us more expressiveness - it would also require us to support MongoDB which is not our core expertise or we could go in other directions like using F# type system but that is going astray from this question....

and we believe the PG types will give us better mileage....
Practical, no. All internal types are represented by an oid. That's an unsigned four-byte integer.

SELECT oid, *
FROM pg_type;


PostgreSQL uses OIDs as an internally unique ID. When you exhaust them you're out.

Creating 1,000 types: NOT A PROBLEM.
Creating 4.3 billion types: PROBLEM.

Update

As a side note, I don't see how you can expose the types usefully to a user. PostgreSQL has a type jsonb. It's indexable and stored as binary, like Mongo's BSON. I would be using that.