Saturation Arithmetic with a PostgreSQL Extension

Introduction In certain situations, it can be beneficial to ignore integer overflow errors. Consider, for instance, an integer table column that typically accommodates small values. On rare occasions, a significantly larger value might be inserted. Attempting to aggregate these values could lead to an integer overflow error, causing the entire aggregate query to fail, which is far from ideal. Handling large values on the client or worker side, where the data is inserted, is one option....

Creating new PostgreSQL enum data types using pg_type_template

Introduction In Adjust we are creating new data types for PostgreSQL, in order to make handling of data easier for us, but also sometimes to save some space. Many of them are written using the C language. Here are some of the more important extensions for us: istore: it is an integer based hstore. In istore both keys and values are represented and stored as integers. pg-base36: a base36 extension, which implements a base36 binary-to-text encoding algorithm....