Go to file
jordi fita mas 1df8abb7d2 Add Debian package 2023-06-19 11:29:15 +02:00
.github/workflows Ignore LLVM for now 2020-10-24 19:37:13 +02:00
debian Add Debian package 2023-06-19 11:29:15 +02:00
.gitignore Remove unnecessary logic 2016-03-01 20:36:43 +01:00
Makefile Update project build process, now using PGXS 2020-10-24 19:14:04 +02:00
README.md Update README.md 2020-10-24 23:47:01 +02:00
iban--1.0.0.sql Update project build process, now using PGXS 2020-10-24 19:14:04 +02:00
iban.control Update project build process, now using PGXS 2020-10-24 19:14:04 +02:00
iban.cpp Move some code stubs 2020-10-24 23:54:50 +02:00

README.md

C/C++ CI

PostgreSQL IBAN

PostgreSQL IBAN extension that can verify International Bank Account Numbers. This ensures that only valid bank account numbers are stored.

Example

CREATE TABLE test_iban (
  name text,
  account iban
)

--
-- Insert data
--

-- Dutch IBAN format
INSERT INTO test_iban (name, account) VALUES ('John', 'NL91ABNA0417164300');
-- German IBAN format
INSERT INTO test_iban (name, account) VALUES ('Doe', 'DE89370400440532013000');

-- Invalid data
INSERT INTO test_iban (name, account) VALUES ('Dean', 'AZ22NABZ00000000137010001944');

--
-- Show output
--

SELECT * FROM test_iban;

Manually test input

SELECT iban_validate('KW81CBKU0000000000001234560101');
-- Or cast
SELECT 'KZ86125KZT5004100100'::iban;

the ::iban datatype can be cast to an text to perform string operations

SELECT 'KZ86125KZT5004100100'::iban::text;

Build

Make sure PostgreSQL development tools are installed (check pg_config)

git clone https://github.com/yorickdewid/PostgreSQL-IBAN
cd PostgreSQL-IBAN
make install

Login to the database and load the extension

CREATE EXTENSION iban;