pg_color
Color data type for PostgreSQL
pg_color · Color data type for PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100272 | pg_color | pg_color | 1.1 | TYPE | Apache-2.0 | C |
PostgreSQL · 10
Usage
Sources:
pg_color 1.1 is an educational extension that adds a compact RGB color base type. Text input is exactly six uppercase hexadecimal digits without a leading hash; output uses the same form. Version 1.1 adds equality and inequality only.
Core Workflow
Object Index
colorstores an RGB value using an integer-sized internal representation and accepts values from 000000 through FFFFFF.color = colorandcolor <> colorare the only operators added by version 1.1.- Input such as a hash-prefixed value or lowercase hexadecimal text is rejected by the parser.
Caveats
- The extension does not define ordering operators, casts, or a B-tree/hash operator class, so do not assume ordinary indexes can support equality predicates.
- It validates representation, not color spaces, alpha channels, profiles, or accessibility.
- Upstream presents the project as a PostgreSQL extension-development example. Test compatibility with the target server major before adopting it in stored schemas.