barcode as a PGSQL function