X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=sql%2Fbase%2Fbase.sql;h=0c4cb15f116c39102d95c8d70263d2698aa1c11e;hp=8141a3b9697d0a6630e8ad747e12c42c4159c8a3;hb=a09dbe656fda90a77c36fd3093f99e7f26f4f480;hpb=ebffe3cb7ce6613541ef0ac6d86372c6c3957a0c diff --git a/sql/base/base.sql b/sql/base/base.sql index 8141a3b..0c4cb15 100644 --- a/sql/base/base.sql +++ b/sql/base/base.sql @@ -227,7 +227,7 @@ CREATE OR REPLACE FUNCTION migration_tools.rebarcode (o TEXT, t BIGINT) RETURNS DECLARE n TEXT := o; BEGIN - IF o ~ E'^\\d+$' AND o !~ E'^0' THEN + IF o ~ E'^\\d+$' AND o !~ E'^0' AND length(o) < 19 THEN -- for reference, the max value for a bigint is 9223372036854775807. May also want to consider the case where folks want to add prefixes to non-numeric barcodes IF o::BIGINT < t THEN n = o::BIGINT + t; END IF;