rom8726.github.io

pg_iban

A PostgreSQL extension providing an IBAN data type and utility functions

Github: github.com/rom8726/pg_iban

pg_iban is a PostgreSQL extension providing an IBAN (International Bank Account Number) data type and several utility functions for validation and manipulation of IBANs.

⚠️ DISCLAIMER: This extension has not been tested in production. You use it at your own risk.

Features

New in Version 1.1:

Installation

  1. Clone the repository:
    git clone https://github.com/rom8726/pg_iban.git
    cd pg_iban
  2. Build and install the extension:
    make
    make install
  3. Add pg_iban to shared_preload_libraries in postgresql.conf:
    shared_preload_libraries = 'pg_iban'
  4. Load the extension into your database:
    CREATE EXTENSION pg_iban;

Upgrading from Previous Versions

If you are upgrading from version 1.0 to 1.1, you can apply the update using:

ALTER EXTENSION pg_iban UPDATE TO '1.1';

Functions

IBAN Validation

New in Version 1.1

Operators

Indexing

Testing

Unit Tests

Unit tests ensure that individual functions and behaviors of the extension are implemented correctly. The extension uses cmocka for unit testing.

make docker-unit-test

Integration Tests

Integration tests validate the extension in a live PostgreSQL environment, ensuring end-to-end correctness.

make docker-integration-test

Directory Structure

Contribution

This is an experimental extension. Contributions and improvements are welcome. Please fork the repository and submit a pull request.