Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 592 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 592 Bytes

pgbrtypes

An experiment to create postgres extensions using Rust pgrx infrastructure.

Also, it's another project to explore brazilian document numbers (CNPJ, CPF, PIS, RG) by creating strong types to each one. The postgres type system will grant:

  • check digits validation
  • int64 storage (better performance and indexing)
  • string conversion and mask

Installation

cargo pgrx package # pg_config must be on PATH

psql
CREATE EXTENSION pgbrtypes;
SELECT CNPJ '191';
        cnpj        
--------------------
 00.000.000/0001-91
(1 row)