Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2010
    Posts
    1

    Unanswered: Inserting Fingerprint templates as varchar not as bytea type in PostgreSQL

    I am not able to insert fingerprint templates in db. I am using the datatype as varchar(4000).
    But when i tried with bytea type itk ok.
    Isn't possible to insert these templates as varchar?
    I have tried with varchar but its showing the illegal argument exception "\0 not allowed".

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    a varchar requires text.

    It sounds as if your fingerprint templates are binary data. (the bytes in the data can be of any value from 00 through FF)

    While you could store the binary data as varchar, it would be very inefficient.

    You would have to convert each byte of data to 2 characters - the text representation of the hexadecimal data. If you are using ascii text, this means that the size of the stored text would be double the size of the original data. And, if you are using unicode, or any other 2 byte text mode, you will need 4 bytes of database storage to hold 1 byte of binary data. Plus, there is the custom encoding and decoding...
    Last edited by loquin; 11-15-10 at 14:13.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •