PostgreSQL: ISN Data Types to store ISBN, ISMN, ISSN, ISBN13, UPC

PostgreSQL provides a wide variety of data types and I am always sharing information about strange data types.

PostgreSQL has ISN Data types, in which you can store few International Standard Number like: ISBN – International Standard Book Numbers, ISMN – International Standard Music Numbers,
ISSN – International Standard Serial Numbers, UPC – Universal Product Codes, EAN13 – European Article Numbers.

You cannot insert invalid format data in ISN data types.
When you insert data in ISN type column, internally It checks the format of data and force to insert only valid format data.

When we stored data in its specified data types, It improves the overall query performance because It knows data format and accordingly assign storage capacity.

Small Demonstration:

First, Create a ISN Extension / Module:

Create a sample table with few ISN datatypes:

Insert a sample data:

SELECT inserted ISN data with valid ISBN number:

Few sample functions to get valid ISN value:

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from

Leave a Reply

Be the First to Comment!

Notify of