eulerto / pg_similarity

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

Extension does not compile against PG16 #42

Open maherbeg opened 9 months ago

maherbeg commented 9 months ago

Hello!

It looks like this extension can not be compiled against Postgres 16 developer libraries. I see this error when attempting to compile the library on Debian bookworm against PG16

31.64 hamming.c:181:65: error: incompatible pointer to integer conversion passing 'char *' to parameter of type 'Datum' (aka 'unsigned long') [-Wint-conversion]
31.64         elog(DEBUG1, "hammingdistance(%s, %s) = %.3f", DatumGetCString(a), DatumGetCString(b), res);
31.64                                                                        ^
31.64 /usr/include/postgresql/16/server/utils/elog.h:239:34: note: expanded from macro 'elog'
31.64         ereport(elevel, errmsg_internal(__VA_ARGS__))
31.64                                         ^~~~~~~~~~~
31.64 /usr/include/postgresql/16/server/utils/elog.h:164:37: note: expanded from macro 'ereport'
31.64         ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
31.64                                            ^~~~~~~~~~~
31.64 /usr/include/postgresql/16/server/utils/elog.h:147:4: note: expanded from macro 'ereport_domain'
31.64                         __VA_ARGS__, errfinish(__FILE__, __LINE__, __func__); \
31.64                         ^~~~~~~~~~~
31.64 /usr/include/postgresql/16/server/postgres.h:335:23: note: passing argument to parameter 'X' here
31.64 DatumGetCString(Datum X)

I see that some Debian maintainers patched this in https://packages.debian.org/trixie/amd64/database/postgresql-16-similarity - Could this get upstreamed here?