eulerto / pg_similarity

set of functions and operators for executing similarity queries
BSD 3-Clause "New" or "Revised" License
361 stars 38 forks source link

ERROR: argument exceeds the maximum length of 1024 bytes #36

Open andersonferbr opened 1 year ago

andersonferbr commented 1 year ago

I'm having an issue when using the smithwaterman() function. I receive the following error:

SELECT content, smithwaterman(content, 'example word') FROM review; SQL Error [22023]: ERROR: argument exceeds the maximum length of 1024 bytes

The size of the string exceeds the limit of 1024 bytes defined. I would like to know if it's possible to increase this limit. I believe that I may need to change the PGS_MAX_STR_LEN or PGS_MAX_TOKEN_LEN variable, but I'm not sure how to do that. Could someone guide me on how to set this variable in PostgreSQL? I appreciate any help in advance!

eulerto commented 1 year ago

It is not a dynamic setting. You need to modify PGS_MAX_STR_LEN in similarity.h and compile the source code. You don't need to change PGS_MAX_TOKEN_LEN.

BTW, why do you need to compare such a long string? Some of these algorithms are not designed to be used with long strings and the performance is terrible in such cases.