This is a fork of Edward Raff's LZJD. The added feature is a plugin for Postgres to allow similarity matching in SQL queries.
- GCC
- CMake
- Boost libraries
- Postgres requirements:
- Server development package, looks like
postgresql-server-dev-12.
- Server development package, looks like
- Check out the code
cd srcmkdir buildcmake ..make
This creates:
liblzjd.shared.so: Shared library for linking against.liblzjd.static.a: Static library for building against.lzjd: Command line application.- If the Postgres server development package was installed, you should also have:
lzjd_psql.so: Postgresl plugin
- Copy
lzjdto/usr/local/bin/or similar, if desired. - Copy
liblzjd.shared.soto/usr/local/lib/liblzjd.so, or similar, if desired. Note the file name change. - Copy
liblzjd.static.ato/usr/local/lib/liblzjd.a, or similar, if desired. Note the file name change here too. - For the Postgres plugin:
- Run the command
pg_config --pkglibdir, this is the installation directory. - Copy
lzjd_psql.soto the directory shown in the above command. Should be/usr/lib/postgresql/XX/lib/where XX is the version number. - As the administrative user for your Postgres environment, run this SQL command to load the plugin:
CREATE OR REPLACE FUNCTION lzjd_compare(TEXT, TEXT) RETURNS INTEGER AS 'lzjd_psql.so', 'pg_lzjd_compare' LANGUAGE 'c';. No restart required, the new functionlzjd_compare()is available.
- Run the command