acoustid / pg_acoustid

PostgreSQL extension for working with AcoustID fingerprints
13 stars 3 forks source link

Integers are out of range #2

Closed victor775 closed 5 years ago

victor775 commented 5 years ago

Hi,

I am trying to use this extension to compare fingerprints generated with fpcalc (libchromaprint-tools). But the problem is what fpcalc generates an array of unsigned integers, like this 3666786748,3670972860,3662389148,2588444364,.. and these extension functions require an array of signed integers. So, when I am trying to do: SELECT acoustid_extract_query('{3626576076,3670972860,3662389148}'); Postgres says:

ERROR: value "3626576076" is out of range for type integer

Can you please advice how to handle this?

lalinsky commented 5 years ago

PostgreSQL doesn't support unsigned 32-bit integers, so you need to convert the output from fpcalc from unsigned to signed.

trostli commented 11 months ago

For anyone else that stumbles on this issue, I was able to overcome this without switching the output of fpcalc from unsigned to signed since I was already storing a bunch of fingerprints in the bigint format on postgres. I switched the functions arguments type to int8[] on my fork and it works as expected: https://github.com/trostli/pg_acoustid/commit/aab644fcbf9d553a27cc1635d091245beb43aaf4

Thank you for all the work you do @lalinsky !