Обсуждение: contrib - fuzzystrmatch installation issue

Поиск
Список
Период
Сортировка

contrib - fuzzystrmatch installation issue

От
"Kenaniah Cerny"
Дата:
Hi everyone,

I am running Postgres 8.3.3 on a CentOS box and I had a few issues when trying to install the fuzzystrmatch library. The library seemed to compile and make install correctly, but when I ran the sql scripts to add the functions to a database, I came up with this issue:

# psql -d template1 -U postgres -f fuzzystrmatch.sql
SET
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
psql:fuzzystrmatch.sql:24: ERROR:  could not find function "difference" in file "/usr/lib/pgsql/fuzzystrmatch.so"
psql:fuzzystrmatch.sql:28: ERROR:  could not find function "dmetaphone" in file "/usr/lib/pgsql/fuzzystrmatch.so"
psql:fuzzystrmatch.sql:32: ERROR:  could not find function "dmetaphone_alt" in file "/usr/lib/pgsql/fuzzystrmatch.so"

Apparently, these three functions did not compile into the module. I'm not much of a C/C++ programmer, but according to the Makefile, both object files were included in the resulting fuzzystrmatch shared object, and the three functions in question where definitely present in fuzzystrmatch.c to begin with.

The following is a list of symbols inside the shared object:

# nm libfuzzystrmatch.so
00002ee4 A __bss_start
00000938 t call_gmon_start
00002ec4 D _codes
00002ee4 b completed.1
00002d7c d __CTOR_END__
00002d78 d __CTOR_LIST__
         U __ctype_b_loc@@GLIBC_2.3
         U __ctype_toupper_loc@@GLIBC_2.3
         U CurrentMemoryContext
         w __cxa_finalize@@GLIBC_2.1.3
00001a64 T difference
         U DirectFunctionCall1
00001ae8 t __do_global_ctors_aux
0000095c t __do_global_dtors_aux
00002ebc d __dso_handle
00002d84 d __DTOR_END__
00002d80 d __DTOR_LIST__
00002d8c A _DYNAMIC
00002ee4 A _edata
         U elog_finish
         U elog_start
00002ee8 A _end
         U errcode
         U errfinish
         U errmsg
         U errstart
00001b18 T _fini
000009b8 t frame_dummy
00001d74 r __FRAME_END__
00001bd4 r __func__.2
00001ca4 r __func__.3
00001bc4 r __func__.5
00002e78 A _GLOBAL_OFFSET_TABLE_
         w __gmon_start__
00000830 T _init
00002d88 d __JCR_END__
00002d88 d __JCR_LIST__
         w _Jv_RegisterClasses
00000f7e t .L1027
000011d7 t .L1034
00001340 t .L110
000012f5 t .L180
000013a8 t .L185
00000d8f t .L208
00000eac t .L253
00001132 t .L254
00001096 t .L266
0000102d t .L392
00000e27 t .L487
00000f90 t .L667
00000f1d t .L760
0000105e t .L774
00000f40 t .L785
0000117f t .L789
00000d55 t .L83
000012a4 t .L874
0000116a t .L930
000011fe t .L932
00000f5c t .L977
000013c7 t .L98
00001251 t .L982
00000a24 T levenshtein
00000bf4 T Lookahead
         U MemoryContextAlloc
000016ac T metaphone
00000c24 T _metaphone
00001cb4 r my_finfo.0
00001cb0 r my_finfo.1
00001bd0 r my_finfo.4
00001bc0 r my_finfo.6
00002ec0 d p.0
         U pg_detoast_datum
00001a4c T pg_finfo_difference
00000a0c T pg_finfo_levenshtein
00000bdc T pg_finfo_metaphone
000018f8 T pg_finfo_soundex
00001bac r Pg_magic_data.7
000009f4 T Pg_magic_func
00001a00 T soundex
00001910 t _soundex
00002ee0 d soundex_table
         U textin
         U textout

The compiler didn't return any errors during the build process, leaving me clueless as to why it's not working correctly. Any help would be greatly appreciated.

Thanks,
Kenaniah Cerny

Re: contrib - fuzzystrmatch installation issue

От
Tom Lane
Дата:
"Kenaniah Cerny" <kenaniah@gmail.com> writes:
> I am running Postgres 8.3.3 on a CentOS box and I had a few issues when
> trying to install the fuzzystrmatch library. The library seemed to compile
> and make install correctly, but when I ran the sql scripts to add the
> functions to a database, I came up with this issue:

> # psql -d template1 -U postgres -f fuzzystrmatch.sql
> SET
> CREATE FUNCTION
> CREATE FUNCTION
> CREATE FUNCTION
> CREATE FUNCTION
> psql:fuzzystrmatch.sql:24: ERROR:  could not find function "difference" in
> file "/usr/lib/pgsql/fuzzystrmatch.so"
> psql:fuzzystrmatch.sql:28: ERROR:  could not find function "dmetaphone" in
> file "/usr/lib/pgsql/fuzzystrmatch.so"
> psql:fuzzystrmatch.sql:32: ERROR:  could not find function "dmetaphone_alt"
> in file "/usr/lib/pgsql/fuzzystrmatch.so"

I'm suspicious that /usr/lib/pgsql/fuzzystrmatch.so is actually the 7.4
version of that module (which is what shipped in RHEL4 to begin with,
and which would've lacked exactly those three functions).  However a
hole in this theory is that an 8.3 server should've refused to load
a 7.4 extension module at all.  Anyway, double check versions,
installation locations, etc.  A self-configured Postgres installation
would not default to installing into /usr/lib/pgsql, so it certainly
seems possible that that file isn't your newly built version.

Another thing that seems pretty odd is that the above complains about
difference(), which *is* present in the .so according to nm.

BTW, why are you compiling fuzzystrmatch for yourself at all, instead
of just installing the postgresql-contrib RPM?

            regards, tom lane

Re: contrib - fuzzystrmatch installation issue

От
Joe Conway
Дата:
Tom Lane wrote:
>> psql:fuzzystrmatch.sql:32: ERROR:  could not find function "dmetaphone_alt"
>> in file "/usr/lib/pgsql/fuzzystrmatch.so"
>
> I'm suspicious that /usr/lib/pgsql/fuzzystrmatch.so is actually the 7.4
> version of that module (which is what shipped in RHEL4 to begin with,
> and which would've lacked exactly those three functions).  However a
> hole in this theory is that an 8.3 server should've refused to load
> a 7.4 extension module at all.  Anyway, double check versions,
> installation locations, etc.  A self-configured Postgres installation
> would not default to installing into /usr/lib/pgsql, so it certainly
> seems possible that that file isn't your newly built version.

He had also written me directly off list -- version mismatch it was. See
below. I should have thought to copy the list on my reply -- sorry about
that.

Joe

----------------------
Kenaniah Cerny wrote:
 > Joe,
 >
 > You hit the nail right on the head. Apparently, I was trying to use
 > Postgres 7.4.x with the 8.1.11 contrib version. Upgrading Postgres to
 > 8.1 solved the issue. Can't believe I did that.
 >
 > Thanks for pointing it out. It would be a great addition to the
 > documentation if the contrib functions were labeled with the versions
 > that they first appear in the stable distro. It would most definitely
 > help out people like me :-/
 >
 > And sorry for the double-email.
 >
 > Thanks,
 > Kenaniah
 >
 > On Sat, Jul 5, 2008 at 4:10 PM, Joe Conway <mail@joeconway.com
 > <mailto:mail@joeconway.com>> wrote:
 >
 >     Kenaniah Cerny wrote:
 >
 >         The compiler didn't return any errors during the build process,
 >         leaving me clueless as to why it's not working correctly.
 >
 >         If you have any insight, please feel free to shoot me back an
 >         email or to call me at (951) 385-9506, as it is slightly urgent.
 >
 >
 >     I see that you simultaneously wrote to the list, but please do that
 >     first next time.
 >
 >     You haven't provided enough information to be sure, but it sounds to
 >     me like you have at least two different versions of Postgres
 >     installed -- probably both 8.3.3 and 7.4.x. Try doing:
 >
 >      locate fuzzystrmatch.so
 >
 >     In 7.4.x the functions being complained about did not exist. You
 >     could also try doing:
 >
 >
 >      psql -d template1 -U postgres
 >      template1=# select version();
 >
 >     and see what version of postgres you wind up attached to.
 >
 >     Joe
 >
 >