GTIN14 support for contrib/isn - Mailing list pgsql-hackers

From Michael Kefeder
Subject GTIN14 support for contrib/isn
Date
Msg-id 12816d23-4aa4-a4b6-26f8-71bd5eb46200@multiwave.ch
Whole thread Raw
Responses Re: GTIN14 support for contrib/isn
List pgsql-hackers
Hello hackers,

For a project of ours we need GTIN14 data type support. The isn 
extension already supports EAN13, and a '0' prefixed EAN13 is a valid 
GTIN14. The leftmost "new" 14th digit is a packaging level indicator 
which we need (= using EAN13 and faking a leading 0 in output doesn't 
cut it).

Looking at the code I saw every format that isn-extension supports is 
stored as an EAN13. Theoretically that can be changed to be GTIN14, but 
that would mean quite a lot of rewrite I feared, so I chose to code only 
GTIN14 I/O separetely to not interfere with any existing conversion 
magic. This yields an easier to understand patch and doesn't touch 
existing functionality. However it introduces redundancy to a certain 
extent.

Find my patch attached. Please let me know if there are things that need 
changes, I'll do my best to get GTIN support into postgresql.

thanks in advance
  mike

Attachment

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: string_to_array, array_to_string function without separator
Next
From: Mitar
Date:
Subject: Re: Feature: triggers on materialized views