On Wednesday, 22 May, 2019 16:56, James K. Lowden <jklow...@schemamania.org> 
wrote:

>On Wed, 22 May 2019 14:20:11 -0600
>"Keith Medcalf" <kmedc...@dessus.com> wrote:

>>  (such as was added to DB2 back in the late 80's early 90's, and
>> which I do not think anyone else has implemented as nicely anywhere
>> else)

>That's an interesting aside.  It would make an interesting OT thread,
>if you're inclined to start it.  ;-)

>I've always thought user-defined types were unnecessary except as a
>convenience.  There are few new primitive types; most user-defined
>types I can think of are "structures" -- sets of columns -- that one
>might like to name and constrain as a new type that may appear in
>many tables.  About the only primitive type I can imagine are
>mathematical: complex numbers or exact numeric representations.

Well, User Defined Types as they were added to DB2 were a rather interesting 
way of doing the addition.  Remember these were added in the late 80's early 
90's when DB2 was just the a simple non-extensible RDBMS and not the thing that 
it is now.

Basically, User Defined Types (UDT) were implemented in a fashion analgous to a 
C++ class (remember that at this time C++ was just a pre-processor for C and a 
C++ class was nothing more than a struct and mangled function names to operate 
on the class).  DB2 UDTs were implemented on top of blobs.  Basically, when you 
declared something as a UDT you were giving a "blob" a type-domain.  Whenever 
you tried to do something with a UDT a "mangled function name" was generated 
that took that blob as the first argument and you merely implemented a bunch of 
functions with the appropriate names that DB2 would use whenever you referred 
to that UDT type, rather than using the builtin functions (this is similar to 
the way languages like Python implement classes).

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.






_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to