|Sunday, June 17th, 2018||Profile|Contact||
|Home | Profile | Freedom | Philosophy | Technology | Other topics | Links & Resources|
This is my first serious attempt at writing C code, and I chose to begin with the not-so-easy task of extending the PostgreSQL database engine with an 8-bit signed integer data type that I call INT1 (an alternative name could also be TINYINT). You are welcome to download my first attempt (and others as this project progresses), which is a work-in-progress, but should be complete insofar as the main key features of a datatype are present, namely index support (BTREE and HASH), conversions with other types, various operators (and as a bonus I included a special operator of ">>>" which performs an unsigned bitwise shift right), etc.
I welcome all feedback. I suspect that there are likely many areas of my code that can be improved (I also intend to make the error messages more consistent), and in particular I did not use the PASSEDBYVALUE option with this type because I intend to create more types in the future that have richer structures for which passing by value will not be suitable (and so I also regard this as practice for those later modules that are presently in the conceptualization stage).
Version 1.01 adds support for generate_series() using INT1 data types (the first two parameters must be of the INT1 data type, otherwise the parameters will be coerced to the INT4 data type since INT4 seems to be the default for untyped integers).
Copyright © 2001-2018 Randolf Richardson. Beautiful British Columbia, Canada.
All rights reserved. All trademarks are the property of their respective owners.