Thread: request a new feature in fuzzystrmatch

request a new feature in fuzzystrmatch

From
Liming Hu
Date:
Hi,

I am studying your levenshtein edit distance contribution in Postgresql.

Can we add Levenshtein-Damerau edit distance since it is used in
spelling checker
instead of levenshtein edit distance?

Levenshtein-Damerau edit distance C source code:

http://stackoverflow.com/questions/10727174/dameraulevenshtein-distance-edit-distance-with-transposition-c-implementation.



Thanks,

Liming


--
Liming Hu
cell: (435)-512-4190
Seattle Washington



Re: request a new feature in fuzzystrmatch

From
Atri Sharma
Date:

Sent from my iPad

On 17-May-2013, at 6:11, Liming Hu <dawninghu@gmail.com> wrote:

> Hi,
>
> I am studying your levenshtein edit distance contribution in Postgresql.
>
> Can we add Levenshtein-Damerau edit distance since it is used in
> spelling checker
> instead of levenshtein edit distance?
>
> Levenshtein-Damerau edit distance C source code:
>
http://stackoverflow.com/questions/10727174/dameraulevenshtein-distance-edit-distance-with-transposition-c-implementation.
>
>
>
>

Could you give some use cases for the same, where the proposed feature does better than the current functionalities?

Regards,

Atri


Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
Hi Atri,

Thanks for the quick response.

levenshtein edit distance defines operations of: insertion, deletion, modification.
Levenshtein-Damerau edit distance defines operations of:  insertion, deletion, modification
and transposition (
it will be two operations in levenshtein edit distance:
one deletion, and one insertion,
).

In spelling checker/corrector, i.e. levenshtein('cta', 'cat') will return 2.
but Levenshtein-Damerau('cta', 'cat') will return 1.
if the maximum error is 1, we can not get 'cat'.

In practice, Levenshtein-Damerau is more widely used than Levenshtein.
I believe you notice "Google automated search suggestions", they use 
Levenshtein-Damerau.

Thanks,

Liming


On 5/17/2013 3:00 AM, Atri Sharma wrote:
>
> Sent from my iPad
>
> On 17-May-2013, at 6:11, Liming Hu <dawninghu@gmail.com> wrote:
>
>> Hi,
>>
>> I am studying your levenshtein edit distance contribution in Postgresql.
>>
>> Can we add Levenshtein-Damerau edit distance since it is used in
>> spelling checker
>> instead of levenshtein edit distance?
>>
>> Levenshtein-Damerau edit distance C source code:
>>
http://stackoverflow.com/questions/10727174/dameraulevenshtein-distance-edit-distance-with-transposition-c-implementation.
>>
>>
>>
>>
> Could you give some use cases for the same, where the proposed feature does better than the current functionalities?
>
> Regards,
>
> Atri




Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
Hi Atri,

I also talked to the author of fuzzystrmatch, he also thinks it is a 
good feature.
Thanks,

Liming

On 5/17/2013 8:21 AM, Liming Hu wrote:
> Hi Atri,
>
> Thanks for the quick response.
>
> levenshtein edit distance defines operations of: insertion, deletion, 
> modification.
> Levenshtein-Damerau edit distance defines operations of: insertion, 
> deletion, modification
> and transposition (
> it will be two operations in levenshtein edit distance:
> one deletion, and one insertion,
> ).
>
> In spelling checker/corrector, i.e.
>  levenshtein('cta', 'cat') will return 2.
> but Levenshtein-Damerau('cta', 'cat') will return 1.
> if the maximum error is 1, we can not get 'cat'.
>
> In practice, Levenshtein-Damerau is more widely used than Levenshtein.
> I believe you notice "Google automated search suggestions", they use 
> Levenshtein-Damerau.
>
> Thanks,
>
> Liming
>
>
> On 5/17/2013 3:00 AM, Atri Sharma wrote:
>>
>> Sent from my iPad
>>
>> On 17-May-2013, at 6:11, Liming Hu <dawninghu@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I am studying your levenshtein edit distance contribution in 
>>> Postgresql.
>>>
>>> Can we add Levenshtein-Damerau edit distance since it is used in
>>> spelling checker
>>> instead of levenshtein edit distance?
>>>
>>> Levenshtein-Damerau edit distance C source code:
>>>
http://stackoverflow.com/questions/10727174/dameraulevenshtein-distance-edit-distance-with-transposition-c-implementation.

>>>
>>>
>>>
>>>
>>>
>> Could you give some use cases for the same, where the proposed 
>> feature does better than the current functionalities?
>>
>> Regards,
>>
>> Atri
>




Re: request a new feature in fuzzystrmatch

From
Atri Sharma
Date:
On Fri, May 17, 2013 at 8:51 PM, Liming Hu <dawninghu@gmail.com> wrote:
> Hi Atri,
>
> Thanks for the quick response.
>
> levenshtein edit distance defines operations of: insertion, deletion,
> modification.
> Levenshtein-Damerau edit distance defines operations of:  insertion,
> deletion, modification
> and transposition (
> it will be two operations in levenshtein edit distance:
> one deletion, and one insertion,
> ).
>
> In spelling checker/corrector, i.e.
>  levenshtein('cta', 'cat') will return 2.
> but Levenshtein-Damerau('cta', 'cat') will return 1.
> if the maximum error is 1, we can not get 'cat'.
>
> In practice, Levenshtein-Damerau is more widely used than Levenshtein.
> I believe you notice "Google automated search suggestions", they use
> Levenshtein-Damerau.
>

Sounds interesting. How can we build this over our current
implementation, or do we need to build it from scratch?

Regards,

Atri



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On 5/17/2013 8:23 AM, Atri Sharma wrote:
> On Fri, May 17, 2013 at 8:51 PM, Liming Hu <dawninghu@gmail.com> wrote:
>> Hi Atri,
>>
>> Thanks for the quick response.
>>
>> levenshtein edit distance defines operations of: insertion, deletion,
>> modification.
>> Levenshtein-Damerau edit distance defines operations of:  insertion,
>> deletion, modification
>> and transposition (
>> it will be two operations in levenshtein edit distance:
>> one deletion, and one insertion,
>> ).
>>
>> In spelling checker/corrector, i.e.
>>   levenshtein('cta', 'cat') will return 2.
>> but Levenshtein-Damerau('cta', 'cat') will return 1.
>> if the maximum error is 1, we can not get 'cat'.
>>
>> In practice, Levenshtein-Damerau is more widely used than Levenshtein.
>> I believe you notice "Google automated search suggestions", they use
>> Levenshtein-Damerau.
>>
> Sounds interesting. How can we build this over our current
> implementation, or do we need to build it from scratch?
>
> Regards,
>
> Atri
I know how to write the code, but just need approval of accepting into 
the new version.



Re: request a new feature in fuzzystrmatch

From
Atri Sharma
Date:
On Fri, May 17, 2013 at 8:56 PM, Liming Hu <dawninghu@gmail.com> wrote:
> On 5/17/2013 8:23 AM, Atri Sharma wrote:
>>
>> On Fri, May 17, 2013 at 8:51 PM, Liming Hu <dawninghu@gmail.com> wrote:
>>>
>>> Hi Atri,
>>>
>>> Thanks for the quick response.
>>>
>>> levenshtein edit distance defines operations of: insertion, deletion,
>>> modification.
>>> Levenshtein-Damerau edit distance defines operations of:  insertion,
>>> deletion, modification
>>> and transposition (
>>> it will be two operations in levenshtein edit distance:
>>> one deletion, and one insertion,
>>> ).
>>>
>>> In spelling checker/corrector, i.e.
>>>   levenshtein('cta', 'cat') will return 2.
>>> but Levenshtein-Damerau('cta', 'cat') will return 1.
>>> if the maximum error is 1, we can not get 'cat'.
>>>
>>> In practice, Levenshtein-Damerau is more widely used than Levenshtein.
>>> I believe you notice "Google automated search suggestions", they use
>>> Levenshtein-Damerau.
>>>
>> Sounds interesting. How can we build this over our current
>> implementation, or do we need to build it from scratch?
>>
>> Regards,
>>
>> Atri
>
> I know how to write the code, but just need approval of accepting into the
> new version.

Well, acceptance depends largely on the implementation and actual
benefit statistics. I would suggest implementing a basic version and
then demonstrating its potential benefits here. It will lead to
clearer ideas for us and lead to improvements in the implementation.

Regards,

Atri
--
Regards,

Atri
l'apprenant



Re: request a new feature in fuzzystrmatch

From
Cédric Villemain
Date:
Hello Liming,

> >> Sounds interesting. How can we build this over our current
> >> implementation, or do we need to build it from scratch?
> >>
> > I know how to write the code, but just need approval of accepting into
> > the new version.
>
> Well, acceptance depends largely on the implementation and actual
> benefit statistics. I would suggest implementing a basic version and
> then demonstrating its potential benefits here. It will lead to
> clearer ideas for us and lead to improvements in the implementation.

You can have a look at this page:
http://wiki.postgresql.org/wiki/Submitting_a_Patch

--
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation

Re: request a new feature in fuzzystrmatch

From
Alvaro Herrera
Date:
Liming Hu escribió:
> Hi Atri,
>
> I also talked to the author of fuzzystrmatch, he also thinks it is a
> good feature.

Yeah, I heard our fuzzystrmatch module being talked down a decade ago
for not considering transpositions, so +1 for getting it patched.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



Re: request a new feature in fuzzystrmatch

From
Atri Sharma
Date:
On Fri, May 17, 2013 at 9:29 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Liming Hu escribió:
>> Hi Atri,
>>
>> I also talked to the author of fuzzystrmatch, he also thinks it is a
>> good feature.
>
> Yeah, I heard our fuzzystrmatch module being talked down a decade ago
> for not considering transpositions, so +1 for getting it patched.
>

That is awesome then. The example Liming provided is itself pretty
interesting and promising.

Regards,

Atri


--
Regards,

Atri
l'apprenant



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
Actually it is easy for me to just modify the code, and use it for me
case, I would like to contribute to the
community. I will write a basic implementation first.

On Fri, May 17, 2013 at 9:10 AM, Atri Sharma <atri.jiit@gmail.com> wrote:
> On Fri, May 17, 2013 at 9:29 PM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
>> Liming Hu escribió:
>>> Hi Atri,
>>>
>>> I also talked to the author of fuzzystrmatch, he also thinks it is a
>>> good feature.
>>
>> Yeah, I heard our fuzzystrmatch module being talked down a decade ago
>> for not considering transpositions, so +1 for getting it patched.
>>
>
> That is awesome then. The example Liming provided is itself pretty
> interesting and promising.
>
> Regards,
>
> Atri
>
>
> --
> Regards,
>
> Atri
> l'apprenant



--
Liming Hu
cell: (435)-512-4190
Seattle Washington



Re: request a new feature in fuzzystrmatch

From
Josh Berkus
Date:
> Can we add Levenshtein-Damerau edit distance since it is used in
> spelling checker
> instead of levenshtein edit distance?

Patches welcome!  You, too, can be a PostgreSQL contributor.

However, you will need to preserve the ability of users to use the old
levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
be hard, just add a new function called levenshtiend().

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>
>> Can we add Levenshtein-Damerau edit distance since it is used in
>> spelling checker
>> instead of levenshtein edit distance?
>
> Patches welcome!  You, too, can be a PostgreSQL contributor.
>
> However, you will need to preserve the ability of users to use the old
> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
> be hard, just add a new function called levenshtiend().
>
I am working on it, I will make it this weekend project.
> --
> Josh Berkus
> PostgreSQL Experts Inc.
> http://pgexperts.com
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers



--
Liming Hu
cell: (435)-512-4190
Seattle Washington



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On 5/17/2013 12:39 PM, Liming Hu wrote:
> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>>> Can we add Levenshtein-Damerau edit distance since it is used in
>>> spelling checker
>>> instead of levenshtein edit distance?
>> Patches welcome!  You, too, can be a PostgreSQL contributor.
>>
>> However, you will need to preserve the ability of users to use the old
>> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
>> be hard, just add a new function called levenshtiend().
>>
> I am working on it, I will make it this weekend project.

I have done that. and put the code at github:
https://github.com/liminghu/fuzzystrmatch

liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo cp fuzzystrmatch.so
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo /etc/init.d/postgresql restart
 * Restarting PostgreSQL 9.1 database server
   [ OK ]


select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
CREATE EXTENSION fuzzystrmatch;

********** Error **********

ERROR: could not load library
"/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
damerau_levenshtein_internal_noncompatible

Any one can help me on this? Thanks.

>> --
>> Josh Berkus
>> PostgreSQL Experts Inc.
>> http://pgexperts.com
>>
>>
>> --
>> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-hackers
>
>
> --
> Liming Hu
> cell: (435)-512-4190
> Seattle Washington




Re: request a new feature in fuzzystrmatch

From
Atri Sharma
Date:
On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:
> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>
>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>>>>
>>>> Can we add Levenshtein-Damerau edit distance since it is used in
>>>> spelling checker
>>>> instead of levenshtein edit distance?
>>>
>>> Patches welcome!  You, too, can be a PostgreSQL contributor.
>>>
>>> However, you will need to preserve the ability of users to use the old
>>> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
>>> be hard, just add a new function called levenshtiend().
>>>
>> I am working on it, I will make it this weekend project.
>
>
> I have done that. and put the code at github:
> https://github.com/liminghu/fuzzystrmatch
>
> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
> sudo cp fuzzystrmatch.so
> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
> sudo /etc/init.d/postgresql restart
>
>  * Restarting PostgreSQL 9.1 database server
>
>    [ OK ]
>
>
> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
> CREATE EXTENSION fuzzystrmatch;
>
> ********** Error **********
>
> ERROR: could not load library
> "/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
> damerau_levenshtein_internal_noncompatible
>
> Any one can help me on this? Thanks.
>

The system is not able to find the required library, and I dont think
using cp to place the library is a very good idea.Did you run Make
Install after you added your work in the Makefile?

Regards,

Atri


--
Regards,

Atri
l'apprenant



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On 5/17/2013 9:10 PM, Atri Sharma wrote:
> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:
>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>>>>> Can we add Levenshtein-Damerau edit distance since it is used in
>>>>> spelling checker
>>>>> instead of levenshtein edit distance?
>>>> Patches welcome!  You, too, can be a PostgreSQL contributor.
>>>>
>>>> However, you will need to preserve the ability of users to use the old
>>>> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
>>>> be hard, just add a new function called levenshtiend().
>>>>
>>> I am working on it, I will make it this weekend project.
>>
>> I have done that. and put the code at github:
>> https://github.com/liminghu/fuzzystrmatch
>>
>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>> sudo cp fuzzystrmatch.so
>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>> sudo /etc/init.d/postgresql restart
>>
>>   * Restarting PostgreSQL 9.1 database server
>>
>>     [ OK ]
>>
>>
>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>> CREATE EXTENSION fuzzystrmatch;
>>
>> ********** Error **********
>>
>> ERROR: could not load library
>> "/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
>> damerau_levenshtein_internal_noncompatible
>>
>> Any one can help me on this? Thanks.
>>
> The system is not able to find the required library, and I dont think
> using cp to place the library is a very good idea.Did you run Make
> Install after you added your work in the Makefile?

I did not run make install. I am running a stable postgresql in my 
laptop, I do not
want to reinstall everything, just want to try this contribution.  I am 
afraid
reinstall it will destroy my configurations, and databases, just do not 
want to mess up.
did you see any thing wrong:
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
https://github.com/liminghu/fuzzystrmatch/blob/master/levenshtein.c

Thanks,

Liming

>
> Regards,
>
> Atri
>
>
> --
> Regards,
>
> Atri
> l'apprenant




Re: request a new feature in fuzzystrmatch

From
Atri Sharma
Date:

Sent from my iPad

On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:

> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:
>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>>>>>> Can we add Levenshtein-Damerau edit distance since it is used in
>>>>>> spelling checker
>>>>>> instead of levenshtein edit distance?
>>>>> Patches welcome!  You, too, can be a PostgreSQL contributor.
>>>>>
>>>>> However, you will need to preserve the ability of users to use the old
>>>>> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
>>>>> be hard, just add a new function called levenshtiend().
>>>> I am working on it, I will make it this weekend project.
>>>
>>> I have done that. and put the code at github:
>>> https://github.com/liminghu/fuzzystrmatch
>>>
>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>> sudo cp fuzzystrmatch.so
>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>> sudo /etc/init.d/postgresql restart
>>>
>>>  * Restarting PostgreSQL 9.1 database server
>>>
>>>    [ OK ]
>>>
>>>
>>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>> CREATE EXTENSION fuzzystrmatch;
>>>
>>> ********** Error **********
>>>
>>> ERROR: could not load library
>>> "/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
>>> damerau_levenshtein_internal_noncompatible
>>>
>>> Any one can help me on this? Thanks.
>> The system is not able to find the required library, and I dont think
>> using cp to place the library is a very good idea.Did you run Make
>> Install after you added your work in the Makefile?
>
> I did not run make install. I am running a stable postgresql in my laptop, I do not
> want to reinstall everything, just want to try this contribution.  I am afraid
> reinstall it will destroy my configurations, and databases, just do not want to mess up.
> did you see any thing wrong:
> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
> https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
> https://github.com/liminghu/fuzzystrmatch/blob/master/



You need not reinstall your entire database for installing/re installing an extension.Running make install from the
extension'sdirectory(after placing it in /contrib of a postgres database source directory) will install the extension
inyour current database without breaking anything. 

Regards,

Atri
>



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>
>
> Sent from my iPad
>
> On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:
>
>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:
>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>>>>>>> Can we add Levenshtein-Damerau edit distance since it is used in
>>>>>>> spelling checker
>>>>>>> instead of levenshtein edit distance?
>>>>>> Patches welcome!  You, too, can be a PostgreSQL contributor.
>>>>>>
>>>>>> However, you will need to preserve the ability of users to use the old
>>>>>> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
>>>>>> be hard, just add a new function called levenshtiend().
>>>>> I am working on it, I will make it this weekend project.
>>>>
>>>> I have done that. and put the code at github:
>>>> https://github.com/liminghu/fuzzystrmatch
>>>>
>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>> sudo cp fuzzystrmatch.so
>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>> sudo /etc/init.d/postgresql restart
>>>>
>>>>  * Restarting PostgreSQL 9.1 database server
>>>>
>>>>    [ OK ]
>>>>
>>>>
>>>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>> CREATE EXTENSION fuzzystrmatch;
>>>>
>>>> ********** Error **********
>>>>
>>>> ERROR: could not load library
>>>> "/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
>>>> damerau_levenshtein_internal_noncompatible
>>>>
>>>> Any one can help me on this? Thanks.
>>> The system is not able to find the required library, and I dont think
>>> using cp to place the library is a very good idea.Did you run Make
>>> Install after you added your work in the Makefile?
>>
>> I did not run make install. I am running a stable postgresql in my laptop, I do not
>> want to reinstall everything, just want to try this contribution.  I am afraid
>> reinstall it will destroy my configurations, and databases, just do not want to mess up.
>> did you see any thing wrong:
>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
>> https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
>> https://github.com/liminghu/fuzzystrmatch/blob/master/
>
>
>
> You need not reinstall your entire database for installing/re installing an extension.Running make install from the
extension'sdirectory(after placing it in /contrib of a postgres database source directory) will install the extension
inyour current database without breaking anything. 

You mean:
liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
make install
?


>
> Regards,
>
> Atri
>>



--
Liming Hu
cell: (435)-512-4190
Seattle Washington



Re: request a new feature in fuzzystrmatch

From
Atri Sharma
Date:

Sent from my iPad

On 18-May-2013, at 10:41, Liming Hu <dawninghu@gmail.com> wrote:

> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:
>>
>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:
>>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>>>>>>>> Can we add Levenshtein-Damerau edit distance since it is used in
>>>>>>>> spelling checker
>>>>>>>> instead of levenshtein edit distance?
>>>>>>> Patches welcome!  You, too, can be a PostgreSQL contributor.
>>>>>>>
>>>>>>> However, you will need to preserve the ability of users to use the old
>>>>>>> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
>>>>>>> be hard, just add a new function called levenshtiend().
>>>>>> I am working on it, I will make it this weekend project.
>>>>>
>>>>> I have done that. and put the code at github:
>>>>> https://github.com/liminghu/fuzzystrmatch
>>>>>
>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>> sudo cp fuzzystrmatch.so
>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>> sudo /etc/init.d/postgresql restart
>>>>>
>>>>> * Restarting PostgreSQL 9.1 database server
>>>>>
>>>>>   [ OK ]
>>>>>
>>>>>
>>>>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>>> CREATE EXTENSION fuzzystrmatch;
>>>>>
>>>>> ********** Error **********
>>>>>
>>>>> ERROR: could not load library
>>>>> "/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
>>>>> damerau_levenshtein_internal_noncompatible
>>>>>
>>>>> Any one can help me on this? Thanks.
>>>> The system is not able to find the required library, and I dont think
>>>> using cp to place the library is a very good idea.Did you run Make
>>>> Install after you added your work in the Makefile?
>>>
>>> I did not run make install. I am running a stable postgresql in my laptop, I do not
>>> want to reinstall everything, just want to try this contribution.  I am afraid
>>> reinstall it will destroy my configurations, and databases, just do not want to mess up.
>>> did you see any thing wrong:
>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
>>> https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
>>> https://github.com/liminghu/fuzzystrmatch/blob/master/
>>
>>
>>
>> You need not reinstall your entire database for installing/re installing an extension.Running make install from the
extension'sdirectory(after placing it in /contrib of a postgres database source directory) will install the extension
inyour current database without breaking anything. 
>
> You mean:
> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
> make install
> ?
>
>

Yes,although,I would run make clean before running make install,just for ensuring that all runs well.

Regards,

Atri



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>
>
> Sent from my iPad
>
> On 18-May-2013, at 10:41, Liming Hu <dawninghu@gmail.com> wrote:
>
>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>>
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:
>>>
>>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:
>>>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>>>>>>>>> Can we add Levenshtein-Damerau edit distance since it is used in
>>>>>>>>> spelling checker
>>>>>>>>> instead of levenshtein edit distance?
>>>>>>>> Patches welcome!  You, too, can be a PostgreSQL contributor.
>>>>>>>>
>>>>>>>> However, you will need to preserve the ability of users to use the old
>>>>>>>> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
>>>>>>>> be hard, just add a new function called levenshtiend().
>>>>>>> I am working on it, I will make it this weekend project.
>>>>>>
>>>>>> I have done that. and put the code at github:
>>>>>> https://github.com/liminghu/fuzzystrmatch
>>>>>>
>>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>> sudo cp fuzzystrmatch.so
>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>> sudo /etc/init.d/postgresql restart
>>>>>>
>>>>>> * Restarting PostgreSQL 9.1 database server
>>>>>>
>>>>>>   [ OK ]
>>>>>>
>>>>>>
>>>>>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>>>> CREATE EXTENSION fuzzystrmatch;
>>>>>>
>>>>>> ********** Error **********
>>>>>>
>>>>>> ERROR: could not load library
>>>>>> "/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
>>>>>> damerau_levenshtein_internal_noncompatible
>>>>>>
>>>>>> Any one can help me on this? Thanks.
>>>>> The system is not able to find the required library, and I dont think
>>>>> using cp to place the library is a very good idea.Did you run Make
>>>>> Install after you added your work in the Makefile?
>>>>
>>>> I did not run make install. I am running a stable postgresql in my laptop, I do not
>>>> want to reinstall everything, just want to try this contribution.  I am afraid
>>>> reinstall it will destroy my configurations, and databases, just do not want to mess up.
>>>> did you see any thing wrong:
>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/
>>>
>>>
>>>
>>> You need not reinstall your entire database for installing/re installing an extension.Running make install from the
extension'sdirectory(after placing it in /contrib of a postgres database source directory) will install the extension
inyour current database without breaking anything. 
>>
>> You mean:
>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>> make install
>> ?
>>
>>
>
> Yes,although,I would run make clean before running make install,just for ensuring that all runs well.
>

liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo make clean
rm -f fuzzystrmatch.so   libfuzzystrmatch.a
rm -f fuzzystrmatch.o dmetaphone.o
liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo make install
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wformat-security
-fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
-I../../src/include -D_GNU_SOURCE   -c -o fuzzystrmatch.o
fuzzystrmatch.c
In file included from fuzzystrmatch.c:250:0:
dameraulevenshtein.c: In function ‘damerau_levenshtein_internal’:
dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
[-Wunused-variable]
dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
[-Wunused-variable]
In file included from fuzzystrmatch.c:253:0:
dameraulevenshtein.c: In function ‘damerau_levenshtein_less_equal_internal’:
dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
[-Wunused-variable]
dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
[-Wunused-variable]
dameraulevenshtein.c: In function ‘dameraulevenshtein_with_costs_noncompatible’:
dameraulevenshtein.c:480:9: warning: ISO C90 forbids mixed
declarations and code [-Wdeclaration-after-statement]
dameraulevenshtein.c:494:10: warning: ISO C90 forbids mixed
declarations and code [-Wdeclaration-after-statement]
fuzzystrmatch.c: In function ‘damerau_levenshtein_with_costs_noncompatible’:
fuzzystrmatch.c:266:2: warning: implicit declaration of function
‘damerau_levenshtein_internal_noncompatible’
[-Wimplicit-function-declaration]
fuzzystrmatch.c: At top level:
dameraulevenshtein.c:40:12: warning: ‘dameraulevenshtein_internal’
declared ‘static’ but never defined [-Wunused-function]
dameraulevenshtein.c:37:12: warning:
‘dameraulevenshtein_less_equal_internal’ declared ‘static’ but never
defined [-Wunused-function]
dameraulevenshtein.c:464:12: warning:
‘dameraulevenshtein_with_costs_noncompatible’ defined but not used
[-Wunused-function]
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wformat-security
-fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
-I../../src/include -D_GNU_SOURCE   -c -o dmetaphone.o dmetaphone.c
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wformat-security
-fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -shared
-o fuzzystrmatch.so fuzzystrmatch.o dmetaphone.o -L../../src/port
-Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags
/bin/mkdir -p '/usr/local/pgsql/lib'
/bin/mkdir -p '/usr/local/pgsql/share/extension'
/bin/mkdir -p '/usr/local/pgsql/share/extension'
/bin/sh ../../config/install-sh -c -m 755  fuzzystrmatch.so
'/usr/local/pgsql/lib/fuzzystrmatch.so'
/bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch.control
'/usr/local/pgsql/share/extension/'
/bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch--1.0.sql
./fuzzystrmatch--unpackaged--1.0.sql
'/usr/local/pgsql/share/extension/'
liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$


After that:

CREATE EXTENSION fuzzystrmatch;
select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);




ERROR:  function dameraulevenshteinnocompatible(unknown, unknown,
integer, integer, integer, integer) does not exist
LINE 1: select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);              ^
HINT:  No function matches the given name and argument types. You
might need to add explicit type casts.


********** Error **********

ERROR: function dameraulevenshteinnocompatible(unknown, unknown,
integer, integer, integer, integer) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might
need to add explicit type casts.
Character: 8


any more suggestion?
Thanks,

Liming
> Regards,
>
> Atri



--
Liming Hu
cell: (435)-512-4190
Seattle Washington



Re: request a new feature in fuzzystrmatch

From
Atri Sharma
Date:

Sent from my iPad

On 18-May-2013, at 11:23, Liming Hu <dawninghu@gmail.com> wrote:

> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 10:41, Liming Hu <dawninghu@gmail.com> wrote:
>>
>>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>>>
>>>>
>>>> Sent from my iPad
>>>>
>>>> On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:
>>>>
>>>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:
>>>>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>>>>>>>>>> Can we add Levenshtein-Damerau edit distance since it is used in
>>>>>>>>>> spelling checker
>>>>>>>>>> instead of levenshtein edit distance?
>>>>>>>>> Patches welcome!  You, too, can be a PostgreSQL contributor.
>>>>>>>>>
>>>>>>>>> However, you will need to preserve the ability of users to use the old
>>>>>>>>> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
>>>>>>>>> be hard, just add a new function called levenshtiend().
>>>>>>>> I am working on it, I will make it this weekend project.
>>>>>>>
>>>>>>> I have done that. and put the code at github:
>>>>>>> https://github.com/liminghu/fuzzystrmatch
>>>>>>>
>>>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>> sudo cp fuzzystrmatch.so
>>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>> sudo /etc/init.d/postgresql restart
>>>>>>>
>>>>>>> * Restarting PostgreSQL 9.1 database server
>>>>>>>
>>>>>>>  [ OK ]
>>>>>>>
>>>>>>>
>>>>>>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>>>>> CREATE EXTENSION fuzzystrmatch;
>>>>>>>
>>>>>>> ********** Error **********
>>>>>>>
>>>>>>> ERROR: could not load library
>>>>>>> "/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
>>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
>>>>>>> damerau_levenshtein_internal_noncompatible
>>>>>>>
>>>>>>> Any one can help me on this? Thanks.
>>>>>> The system is not able to find the required library, and I dont think
>>>>>> using cp to place the library is a very good idea.Did you run Make
>>>>>> Install after you added your work in the Makefile?
>>>>>
>>>>> I did not run make install. I am running a stable postgresql in my laptop, I do not
>>>>> want to reinstall everything, just want to try this contribution.  I am afraid
>>>>> reinstall it will destroy my configurations, and databases, just do not want to mess up.
>>>>> did you see any thing wrong:
>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/
>>>>
>>>>
>>>>
>>>> You need not reinstall your entire database for installing/re installing an extension.Running make install from
theextension's directory(after placing it in /contrib of a postgres database source directory) will install the
extensionin your current database without breaking anything. 
>>>
>>> You mean:
>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>> make install
>>> ?
>>
>> Yes,although,I would run make clean before running make install,just for ensuring that all runs well.
>
> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
> sudo make clean
> rm -f fuzzystrmatch.so   libfuzzystrmatch.a
> rm -f fuzzystrmatch.o dmetaphone.o
> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
> sudo make install
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
> -I../../src/include -D_GNU_SOURCE   -c -o fuzzystrmatch.o
> fuzzystrmatch.c
> In file included from fuzzystrmatch.c:250:0:
> dameraulevenshtein.c: In function ‘damerau_levenshtein_internal’:
> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
> [-Wunused-variable]
> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
> [-Wunused-variable]
> In file included from fuzzystrmatch.c:253:0:
> dameraulevenshtein.c: In function ‘damerau_levenshtein_less_equal_internal’:
> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
> [-Wunused-variable]
> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
> [-Wunused-variable]
> dameraulevenshtein.c: In function ‘dameraulevenshtein_with_costs_noncompatible’:
> dameraulevenshtein.c:480:9: warning: ISO C90 forbids mixed
> declarations and code [-Wdeclaration-after-statement]
> dameraulevenshtein.c:494:10: warning: ISO C90 forbids mixed
> declarations and code [-Wdeclaration-after-statement]
> fuzzystrmatch.c: In function ‘damerau_levenshtein_with_costs_noncompatible’:
> fuzzystrmatch.c:266:2: warning: implicit declaration of function
> ‘damerau_levenshtein_internal_noncompatible’
> [-Wimplicit-function-declaration]
> fuzzystrmatch.c: At top level:
> dameraulevenshtein.c:40:12: warning: ‘dameraulevenshtein_internal’
> declared ‘static’ but never defined [-Wunused-function]
> dameraulevenshtein.c:37:12: warning:
> ‘dameraulevenshtein_less_equal_internal’ declared ‘static’ but never
> defined [-Wunused-function]
> dameraulevenshtein.c:464:12: warning:
> ‘dameraulevenshtein_with_costs_noncompatible’ defined but not used
> [-Wunused-function]
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
> -I../../src/include -D_GNU_SOURCE   -c -o dmetaphone.o dmetaphone.c
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -shared
> -o fuzzystrmatch.so fuzzystrmatch.o dmetaphone.o -L../../src/port
> -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags
> /bin/mkdir -p '/usr/local/pgsql/lib'
> /bin/mkdir -p '/usr/local/pgsql/share/extension'
> /bin/mkdir -p '/usr/local/pgsql/share/extension'
> /bin/sh ../../config/install-sh -c -m 755  fuzzystrmatch.so
> '/usr/local/pgsql/lib/fuzzystrmatch.so'
> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch.control
> '/usr/local/pgsql/share/extension/'
> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch--1.0.sql
> ./fuzzystrmatch--unpackaged--1.0.sql
> '/usr/local/pgsql/share/extension/'
> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>
>
> After that:
>
> CREATE EXTENSION fuzzystrmatch;
> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>
>
>
>
> ERROR:  function dameraulevenshteinnocompatible(unknown, unknown,
> integer, integer, integer, integer) does not exist
> LINE 1: select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>               ^
> HINT:  No function matches the given name and argument types. You
> might need to add explicit type casts.
>
>
> ********** Error **********
>
> ERROR: function dameraulevenshteinnocompatible(unknown, unknown,
> integer, integer, integer, integer) does not exist
> SQL state: 42883
> Hint: No function matches the given name and argument types. You might
> need to add explicit type casts.
> Character: 8
>
>
>

Ok,so now, we are in issues with the code and possibly, the configurations.

First up, I would fix the warnings
that are being generated while compiling.Those may lead to hard to detect errors later on.
>

It seems that the functions you added are not being created in the database.Are you sure that you have modified the
.SQLfiles correctly to create you functions as well,and that you are using the correct SQL files while installing? 

Does this happen only with dameraulevenshteinnocompatible, or with every function that you added? Have you tried using
oneof the original functions of fuzzystrmatch,to ensure that the original functionalities are still working? 

Regards,

Atri


Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>
>
> Sent from my iPad
>
> On 18-May-2013, at 11:23, Liming Hu <dawninghu@gmail.com> wrote:
>
>> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>>
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 10:41, Liming Hu <dawninghu@gmail.com> wrote:
>>>
>>>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>>>>
>>>>>
>>>>> Sent from my iPad
>>>>>
>>>>> On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:
>>>>>
>>>>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>>>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:
>>>>>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>>>>>>>>>>> Can we add Levenshtein-Damerau edit distance since it is used in
>>>>>>>>>>> spelling checker
>>>>>>>>>>> instead of levenshtein edit distance?
>>>>>>>>>> Patches welcome!  You, too, can be a PostgreSQL contributor.
>>>>>>>>>>
>>>>>>>>>> However, you will need to preserve the ability of users to use the old
>>>>>>>>>> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
>>>>>>>>>> be hard, just add a new function called levenshtiend().
>>>>>>>>> I am working on it, I will make it this weekend project.
>>>>>>>>
>>>>>>>> I have done that. and put the code at github:
>>>>>>>> https://github.com/liminghu/fuzzystrmatch
>>>>>>>>
>>>>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>>> sudo cp fuzzystrmatch.so
>>>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>>> sudo /etc/init.d/postgresql restart
>>>>>>>>
>>>>>>>> * Restarting PostgreSQL 9.1 database server
>>>>>>>>
>>>>>>>>  [ OK ]
>>>>>>>>
>>>>>>>>
>>>>>>>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>>>>>> CREATE EXTENSION fuzzystrmatch;
>>>>>>>>
>>>>>>>> ********** Error **********
>>>>>>>>
>>>>>>>> ERROR: could not load library
>>>>>>>> "/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
>>>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
>>>>>>>> damerau_levenshtein_internal_noncompatible
>>>>>>>>
>>>>>>>> Any one can help me on this? Thanks.
>>>>>>> The system is not able to find the required library, and I dont think
>>>>>>> using cp to place the library is a very good idea.Did you run Make
>>>>>>> Install after you added your work in the Makefile?
>>>>>>
>>>>>> I did not run make install. I am running a stable postgresql in my laptop, I do not
>>>>>> want to reinstall everything, just want to try this contribution.  I am afraid
>>>>>> reinstall it will destroy my configurations, and databases, just do not want to mess up.
>>>>>> did you see any thing wrong:
>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/
>>>>>
>>>>>
>>>>>
>>>>> You need not reinstall your entire database for installing/re installing an extension.Running make install from
theextension's directory(after placing it in /contrib of a postgres database source directory) will install the
extensionin your current database without breaking anything. 
>>>>
>>>> You mean:
>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>> make install
>>>> ?
>>>
>>> Yes,although,I would run make clean before running make install,just for ensuring that all runs well.
>>
>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>> sudo make clean
>> rm -f fuzzystrmatch.so   libfuzzystrmatch.a
>> rm -f fuzzystrmatch.o dmetaphone.o
>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>> sudo make install
>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
>> -I../../src/include -D_GNU_SOURCE   -c -o fuzzystrmatch.o
>> fuzzystrmatch.c
>> In file included from fuzzystrmatch.c:250:0:
>> dameraulevenshtein.c: In function ‘damerau_levenshtein_internal’:
>> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
>> [-Wunused-variable]
>> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
>> [-Wunused-variable]
>> In file included from fuzzystrmatch.c:253:0:
>> dameraulevenshtein.c: In function ‘damerau_levenshtein_less_equal_internal’:
>> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
>> [-Wunused-variable]
>> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
>> [-Wunused-variable]
>> dameraulevenshtein.c: In function ‘dameraulevenshtein_with_costs_noncompatible’:
>> dameraulevenshtein.c:480:9: warning: ISO C90 forbids mixed
>> declarations and code [-Wdeclaration-after-statement]
>> dameraulevenshtein.c:494:10: warning: ISO C90 forbids mixed
>> declarations and code [-Wdeclaration-after-statement]
>> fuzzystrmatch.c: In function ‘damerau_levenshtein_with_costs_noncompatible’:
>> fuzzystrmatch.c:266:2: warning: implicit declaration of function
>> ‘damerau_levenshtein_internal_noncompatible’
>> [-Wimplicit-function-declaration]
>> fuzzystrmatch.c: At top level:
>> dameraulevenshtein.c:40:12: warning: ‘dameraulevenshtein_internal’
>> declared ‘static’ but never defined [-Wunused-function]
>> dameraulevenshtein.c:37:12: warning:
>> ‘dameraulevenshtein_less_equal_internal’ declared ‘static’ but never
>> defined [-Wunused-function]
>> dameraulevenshtein.c:464:12: warning:
>> ‘dameraulevenshtein_with_costs_noncompatible’ defined but not used
>> [-Wunused-function]
>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
>> -I../../src/include -D_GNU_SOURCE   -c -o dmetaphone.o dmetaphone.c
>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -shared
>> -o fuzzystrmatch.so fuzzystrmatch.o dmetaphone.o -L../../src/port
>> -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags
>> /bin/mkdir -p '/usr/local/pgsql/lib'
>> /bin/mkdir -p '/usr/local/pgsql/share/extension'
>> /bin/mkdir -p '/usr/local/pgsql/share/extension'
>> /bin/sh ../../config/install-sh -c -m 755  fuzzystrmatch.so
>> '/usr/local/pgsql/lib/fuzzystrmatch.so'
>> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch.control
>> '/usr/local/pgsql/share/extension/'
>> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch--1.0.sql
>> ./fuzzystrmatch--unpackaged--1.0.sql
>> '/usr/local/pgsql/share/extension/'
>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>
>>
>> After that:
>>
>> CREATE EXTENSION fuzzystrmatch;
>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>
>>
>>
>>
>> ERROR:  function dameraulevenshteinnocompatible(unknown, unknown,
>> integer, integer, integer, integer) does not exist
>> LINE 1: select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>               ^
>> HINT:  No function matches the given name and argument types. You
>> might need to add explicit type casts.
>>
>>
>> ********** Error **********
>>
>> ERROR: function dameraulevenshteinnocompatible(unknown, unknown,
>> integer, integer, integer, integer) does not exist
>> SQL state: 42883
>> Hint: No function matches the given name and argument types. You might
>> need to add explicit type casts.
>> Character: 8
>>
>>
>>
>
> Ok,so now, we are in issues with the code and possibly, the configurations.
>
> First up, I would fix the warnings
> that are being generated while compiling.Those may lead to hard to detect errors later on.
>>
>
> It seems that the functions you added are not being created in the database.Are you sure that you have modified the
.SQLfiles correctly to create you functions as well,and that you are using the correct SQL files while installing? 
>
> Does this happen only with dameraulevenshteinnocompatible, or with every function that you added? Have you tried
usingone of the original functions of fuzzystrmatch,to ensure that the original functionalities are still working? 
>


it seems the make install command will copy fuzzystrmatch.so to:
liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
total 48
drwxr-xr-x 2 root root  4096 May 17 23:14 .
drwxr-xr-x 4 root root  4096 May 17 22:39 ..
-rwxr-xr-x 1 root root 40640 May 17 23:14 fuzzystrmatch.so

liming@liming-UX31A:/usr/local/pgsql/share/extension$ ls -la
total 28
drwxr-xr-x 2 root root 4096 May 17 23:14 .
drwxr-xr-x 3 root root 4096 May 17 22:39 ..
-rw-r--r-- 1 root root 2250 May 17 22:48 fuzzystrmatch--1.0.sql
-rw-r--r-- 1 root root 2250 May 17 23:14 fuzzystrmatch--1.1.sql
-rw-r--r-- 1 root root  175 May 17 23:14 fuzzystrmatch.control
-rw-r--r-- 1 root root 1945 May 17 22:48 fuzzystrmatch--unpackaged--1.0.sql
-rw-r--r-- 1 root root 1945 May 17 23:14 fuzzystrmatch--unpackaged--1.1.sql

instead of:

liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
-rw-r--r-- 1 root root 30520 May 17 19:50
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so

That's the problem.




> Regards,
>
> Atri



--
Liming Hu
cell: (435)-512-4190
Seattle Washington



Re: request a new feature in fuzzystrmatch

From
Atri Sharma
Date:

Sent from my iPad

On 18-May-2013, at 12:07, Liming Hu <dawninghu@gmail.com> wrote:

> On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 11:23, Liming Hu <dawninghu@gmail.com> wrote:
>>
>>> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>>>
>>>>
>>>> Sent from my iPad
>>>>
>>>> On 18-May-2013, at 10:41, Liming Hu <dawninghu@gmail.com> wrote:
>>>>
>>>>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>>>>>
>>>>>>
>>>>>> Sent from my iPad
>>>>>>
>>>>>> On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:
>>>>>>
>>>>>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>>>>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:
>>>>>>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>>>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>>>>>>>>>>>> Can we add Levenshtein-Damerau edit distance since it is used in
>>>>>>>>>>>> spelling checker
>>>>>>>>>>>> instead of levenshtein edit distance?
>>>>>>>>>>> Patches welcome!  You, too, can be a PostgreSQL contributor.
>>>>>>>>>>>
>>>>>>>>>>> However, you will need to preserve the ability of users to use the old
>>>>>>>>>>> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
>>>>>>>>>>> be hard, just add a new function called levenshtiend().
>>>>>>>>>> I am working on it, I will make it this weekend project.
>>>>>>>>>
>>>>>>>>> I have done that. and put the code at github:
>>>>>>>>> https://github.com/liminghu/fuzzystrmatch
>>>>>>>>>
>>>>>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>>>> sudo cp fuzzystrmatch.so
>>>>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>>>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>>>> sudo /etc/init.d/postgresql restart
>>>>>>>>>
>>>>>>>>> * Restarting PostgreSQL 9.1 database server
>>>>>>>>>
>>>>>>>>> [ OK ]
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>>>>>>> CREATE EXTENSION fuzzystrmatch;
>>>>>>>>>
>>>>>>>>> ********** Error **********
>>>>>>>>>
>>>>>>>>> ERROR: could not load library
>>>>>>>>> "/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
>>>>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
>>>>>>>>> damerau_levenshtein_internal_noncompatible
>>>>>>>>>
>>>>>>>>> Any one can help me on this? Thanks.
>>>>>>>> The system is not able to find the required library, and I dont think
>>>>>>>> using cp to place the library is a very good idea.Did you run Make
>>>>>>>> Install after you added your work in the Makefile?
>>>>>>>
>>>>>>> I did not run make install. I am running a stable postgresql in my laptop, I do not
>>>>>>> want to reinstall everything, just want to try this contribution.  I am afraid
>>>>>>> reinstall it will destroy my configurations, and databases, just do not want to mess up.
>>>>>>> did you see any thing wrong:
>>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
>>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
>>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
>>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
>>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/
>>>>>>
>>>>>>
>>>>>>
>>>>>> You need not reinstall your entire database for installing/re installing an extension.Running make install from
theextension's directory(after placing it in /contrib of a postgres database source directory) will install the
extensionin your current database without breaking anything. 
>>>>>
>>>>> You mean:
>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>> make install
>>>>> ?
>>>>
>>>> Yes,although,I would run make clean before running make install,just for ensuring that all runs well.
>>>
>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>> sudo make clean
>>> rm -f fuzzystrmatch.so   libfuzzystrmatch.a
>>> rm -f fuzzystrmatch.o dmetaphone.o
>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>> sudo make install
>>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
>>> -I../../src/include -D_GNU_SOURCE   -c -o fuzzystrmatch.o
>>> fuzzystrmatch.c
>>> In file included from fuzzystrmatch.c:250:0:
>>> dameraulevenshtein.c: In function ‘damerau_levenshtein_internal’:
>>> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
>>> [-Wunused-variable]
>>> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
>>> [-Wunused-variable]
>>> In file included from fuzzystrmatch.c:253:0:
>>> dameraulevenshtein.c: In function ‘damerau_levenshtein_less_equal_internal’:
>>> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
>>> [-Wunused-variable]
>>> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
>>> [-Wunused-variable]
>>> dameraulevenshtein.c: In function ‘dameraulevenshtein_with_costs_noncompatible’:
>>> dameraulevenshtein.c:480:9: warning: ISO C90 forbids mixed
>>> declarations and code [-Wdeclaration-after-statement]
>>> dameraulevenshtein.c:494:10: warning: ISO C90 forbids mixed
>>> declarations and code [-Wdeclaration-after-statement]
>>> fuzzystrmatch.c: In function ‘damerau_levenshtein_with_costs_noncompatible’:
>>> fuzzystrmatch.c:266:2: warning: implicit declaration of function
>>> ‘damerau_levenshtein_internal_noncompatible’
>>> [-Wimplicit-function-declaration]
>>> fuzzystrmatch.c: At top level:
>>> dameraulevenshtein.c:40:12: warning: ‘dameraulevenshtein_internal’
>>> declared ‘static’ but never defined [-Wunused-function]
>>> dameraulevenshtein.c:37:12: warning:
>>> ‘dameraulevenshtein_less_equal_internal’ declared ‘static’ but never
>>> defined [-Wunused-function]
>>> dameraulevenshtein.c:464:12: warning:
>>> ‘dameraulevenshtein_with_costs_noncompatible’ defined but not used
>>> [-Wunused-function]
>>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
>>> -I../../src/include -D_GNU_SOURCE   -c -o dmetaphone.o dmetaphone.c
>>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -shared
>>> -o fuzzystrmatch.so fuzzystrmatch.o dmetaphone.o -L../../src/port
>>> -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags
>>> /bin/mkdir -p '/usr/local/pgsql/lib'
>>> /bin/mkdir -p '/usr/local/pgsql/share/extension'
>>> /bin/mkdir -p '/usr/local/pgsql/share/extension'
>>> /bin/sh ../../config/install-sh -c -m 755  fuzzystrmatch.so
>>> '/usr/local/pgsql/lib/fuzzystrmatch.so'
>>> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch.control
>>> '/usr/local/pgsql/share/extension/'
>>> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch--1.0.sql
>>> ./fuzzystrmatch--unpackaged--1.0.sql
>>> '/usr/local/pgsql/share/extension/'
>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>
>>>
>>> After that:
>>>
>>> CREATE EXTENSION fuzzystrmatch;
>>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>
>>>
>>>
>>>
>>> ERROR:  function dameraulevenshteinnocompatible(unknown, unknown,
>>> integer, integer, integer, integer) does not exist
>>> LINE 1: select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>              ^
>>> HINT:  No function matches the given name and argument types. You
>>> might need to add explicit type casts.
>>>
>>>
>>> ********** Error **********
>>>
>>> ERROR: function dameraulevenshteinnocompatible(unknown, unknown,
>>> integer, integer, integer, integer) does not exist
>>> SQL state: 42883
>>> Hint: No function matches the given name and argument types. You might
>>> need to add explicit type casts.
>>> Character: 8
>>>
>>>
>>>
>>
>> Ok,so now, we are in issues with the code and possibly, the configurations.
>>
>> First up, I would fix the warnings
>> that are being generated while compiling.Those may lead to hard to detect errors later on.
>>>
>>
>> It seems that the functions you added are not being created in the database.Are you sure that you have modified the
.SQLfiles correctly to create you functions as well,and that you are using the correct SQL files while installing? 
>>
>> Does this happen only with dameraulevenshteinnocompatible, or with every function that you added? Have you tried
usingone of the original functions of fuzzystrmatch,to ensure that the original functionalities are still working? 
>>
>
>
> it seems the make install command will copy fuzzystrmatch.so to:
> liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
> total 48
> drwxr-xr-x 2 root root  4096 May 17 23:14 .
> drwxr-xr-x 4 root root  4096 May 17 22:39 ..
> -rwxr-xr-x 1 root root 40640 May 17 23:14 fuzzystrmatch.so
>
> liming@liming-UX31A:/usr/local/pgsql/share/extension$ ls -la
> total 28
> drwxr-xr-x 2 root root 4096 May 17 23:14 .
> drwxr-xr-x 3 root root 4096 May 17 22:39 ..
> -rw-r--r-- 1 root root 2250 May 17 22:48 fuzzystrmatch--1.0.sql
> -rw-r--r-- 1 root root 2250 May 17 23:14 fuzzystrmatch--1.1.sql
> -rw-r--r-- 1 root root  175 May 17 23:14 fuzzystrmatch.control
> -rw-r--r-- 1 root root 1945 May 17 22:48 fuzzystrmatch--unpackaged--1.0.sql
> -rw-r--r-- 1 root root 1945 May 17 23:14 fuzzystrmatch--unpackaged--1.1.sql
>
> instead of:
>
> liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
> -rw-r--r-- 1 root root 30520 May 17 19:50
> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>
>

The files will be copied to your pkglibdir path, which you can find by running pg_config --pkglibdir

Regards,

Atri
>



Re: request a new feature in fuzzystrmatch

From
Atri Sharma
Date:

Sent from my iPad

On 18-May-2013, at 12:34, Liming Hu <dawninghu@gmail.com> wrote:

> On Fri, May 17, 2013 at 11:44 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 12:07, Liming Hu <dawninghu@gmail.com> wrote:
>>
>>> On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>>>
>>>>
>>>> Sent from my iPad
>>>>
>>>> On 18-May-2013, at 11:23, Liming Hu <dawninghu@gmail.com> wrote:
>>>>
>>>>> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>>>>>
>>>>>>
>>>>>> Sent from my iPad
>>>>>>
>>>>>> On 18-May-2013, at 10:41, Liming Hu <dawninghu@gmail.com> wrote:
>>>>>>
>>>>>>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> Sent from my iPad
>>>>>>>>
>>>>>>>> On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>>>>>>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:
>>>>>>>>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>>>>>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>>>>>>>>>>>>>> Can we add Levenshtein-Damerau edit distance since it is used in
>>>>>>>>>>>>>> spelling checker
>>>>>>>>>>>>>> instead of levenshtein edit distance?
>>>>>>>>>>>>> Patches welcome!  You, too, can be a PostgreSQL contributor.
>>>>>>>>>>>>>
>>>>>>>>>>>>> However, you will need to preserve the ability of users to use the old
>>>>>>>>>>>>> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
>>>>>>>>>>>>> be hard, just add a new function called levenshtiend().
>>>>>>>>>>>> I am working on it, I will make it this weekend project.
>>>>>>>>>>>
>>>>>>>>>>> I have done that. and put the code at github:
>>>>>>>>>>> https://github.com/liminghu/fuzzystrmatch
>>>>>>>>>>>
>>>>>>>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>>>>>> sudo cp fuzzystrmatch.so
>>>>>>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>>>>>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>>>>>> sudo /etc/init.d/postgresql restart
>>>>>>>>>>>
>>>>>>>>>>> * Restarting PostgreSQL 9.1 database server
>>>>>>>>>>>
>>>>>>>>>>> [ OK ]
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>>>>>>>>> CREATE EXTENSION fuzzystrmatch;
>>>>>>>>>>>
>>>>>>>>>>> ********** Error **********
>>>>>>>>>>>
>>>>>>>>>>> ERROR: could not load library
>>>>>>>>>>> "/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
>>>>>>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
>>>>>>>>>>> damerau_levenshtein_internal_noncompatible
>>>>>>>>>>>
>>>>>>>>>>> Any one can help me on this? Thanks.
>>>>>>>>>> The system is not able to find the required library, and I dont think
>>>>>>>>>> using cp to place the library is a very good idea.Did you run Make
>>>>>>>>>> Install after you added your work in the Makefile?
>>>>>>>>>
>>>>>>>>> I did not run make install. I am running a stable postgresql in my laptop, I do not
>>>>>>>>> want to reinstall everything, just want to try this contribution.  I am afraid
>>>>>>>>> reinstall it will destroy my configurations, and databases, just do not want to mess up.
>>>>>>>>> did you see any thing wrong:
>>>>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
>>>>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
>>>>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
>>>>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
>>>>>>>>> https://github.com/liminghu/fuzzystrmatch/blob/master/
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> You need not reinstall your entire database for installing/re installing an extension.Running make install
fromthe extension's directory(after placing it in /contrib of a postgres database source directory) will install the
extensionin your current database without breaking anything. 
>>>>>>>
>>>>>>> You mean:
>>>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>> make install
>>>>>>> ?
>>>>>>
>>>>>> Yes,although,I would run make clean before running make install,just for ensuring that all runs well.
>>>>>
>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>> sudo make clean
>>>>> rm -f fuzzystrmatch.so   libfuzzystrmatch.a
>>>>> rm -f fuzzystrmatch.o dmetaphone.o
>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>> sudo make install
>>>>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>>>>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>>>>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
>>>>> -I../../src/include -D_GNU_SOURCE   -c -o fuzzystrmatch.o
>>>>> fuzzystrmatch.c
>>>>> In file included from fuzzystrmatch.c:250:0:
>>>>> dameraulevenshtein.c: In function ‘damerau_levenshtein_internal’:
>>>>> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
>>>>> [-Wunused-variable]
>>>>> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
>>>>> [-Wunused-variable]
>>>>> In file included from fuzzystrmatch.c:253:0:
>>>>> dameraulevenshtein.c: In function ‘damerau_levenshtein_less_equal_internal’:
>>>>> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
>>>>> [-Wunused-variable]
>>>>> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
>>>>> [-Wunused-variable]
>>>>> dameraulevenshtein.c: In function ‘dameraulevenshtein_with_costs_noncompatible’:
>>>>> dameraulevenshtein.c:480:9: warning: ISO C90 forbids mixed
>>>>> declarations and code [-Wdeclaration-after-statement]
>>>>> dameraulevenshtein.c:494:10: warning: ISO C90 forbids mixed
>>>>> declarations and code [-Wdeclaration-after-statement]
>>>>> fuzzystrmatch.c: In function ‘damerau_levenshtein_with_costs_noncompatible’:
>>>>> fuzzystrmatch.c:266:2: warning: implicit declaration of function
>>>>> ‘damerau_levenshtein_internal_noncompatible’
>>>>> [-Wimplicit-function-declaration]
>>>>> fuzzystrmatch.c: At top level:
>>>>> dameraulevenshtein.c:40:12: warning: ‘dameraulevenshtein_internal’
>>>>> declared ‘static’ but never defined [-Wunused-function]
>>>>> dameraulevenshtein.c:37:12: warning:
>>>>> ‘dameraulevenshtein_less_equal_internal’ declared ‘static’ but never
>>>>> defined [-Wunused-function]
>>>>> dameraulevenshtein.c:464:12: warning:
>>>>> ‘dameraulevenshtein_with_costs_noncompatible’ defined but not used
>>>>> [-Wunused-function]
>>>>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>>>>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>>>>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
>>>>> -I../../src/include -D_GNU_SOURCE   -c -o dmetaphone.o dmetaphone.c
>>>>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>>>>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>>>>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -shared
>>>>> -o fuzzystrmatch.so fuzzystrmatch.o dmetaphone.o -L../../src/port
>>>>> -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags
>>>>> /bin/mkdir -p '/usr/local/pgsql/lib'
>>>>> /bin/mkdir -p '/usr/local/pgsql/share/extension'
>>>>> /bin/mkdir -p '/usr/local/pgsql/share/extension'
>>>>> /bin/sh ../../config/install-sh -c -m 755  fuzzystrmatch.so
>>>>> '/usr/local/pgsql/lib/fuzzystrmatch.so'
>>>>> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch.control
>>>>> '/usr/local/pgsql/share/extension/'
>>>>> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch--1.0.sql
>>>>> ./fuzzystrmatch--unpackaged--1.0.sql
>>>>> '/usr/local/pgsql/share/extension/'
>>>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>
>>>>>
>>>>> After that:
>>>>>
>>>>> CREATE EXTENSION fuzzystrmatch;
>>>>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ERROR:  function dameraulevenshteinnocompatible(unknown, unknown,
>>>>> integer, integer, integer, integer) does not exist
>>>>> LINE 1: select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>>>             ^
>>>>> HINT:  No function matches the given name and argument types. You
>>>>> might need to add explicit type casts.
>>>>>
>>>>>
>>>>> ********** Error **********
>>>>>
>>>>> ERROR: function dameraulevenshteinnocompatible(unknown, unknown,
>>>>> integer, integer, integer, integer) does not exist
>>>>> SQL state: 42883
>>>>> Hint: No function matches the given name and argument types. You might
>>>>> need to add explicit type casts.
>>>>> Character: 8
>>>>>
>>>>>
>>>>>
>>>>
>>>> Ok,so now, we are in issues with the code and possibly, the configurations.
>>>>
>>>> First up, I would fix the warnings
>>>> that are being generated while compiling.Those may lead to hard to detect errors later on.
>>>>>
>>>>
>>>> It seems that the functions you added are not being created in the database.Are you sure that you have modified
the.SQL files correctly to create you functions as well,and that you are using the correct SQL files while installing? 
>>>>
>>>> Does this happen only with dameraulevenshteinnocompatible, or with every function that you added? Have you tried
usingone of the original functions of fuzzystrmatch,to ensure that the original functionalities are still working? 
>>>>
>>>
>>>
>>> it seems the make install command will copy fuzzystrmatch.so to:
>>> liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
>>> total 48
>>> drwxr-xr-x 2 root root  4096 May 17 23:14 .
>>> drwxr-xr-x 4 root root  4096 May 17 22:39 ..
>>> -rwxr-xr-x 1 root root 40640 May 17 23:14 fuzzystrmatch.so
>>>
>>> liming@liming-UX31A:/usr/local/pgsql/share/extension$ ls -la
>>> total 28
>>> drwxr-xr-x 2 root root 4096 May 17 23:14 .
>>> drwxr-xr-x 3 root root 4096 May 17 22:39 ..
>>> -rw-r--r-- 1 root root 2250 May 17 22:48 fuzzystrmatch--1.0.sql
>>> -rw-r--r-- 1 root root 2250 May 17 23:14 fuzzystrmatch--1.1.sql
>>> -rw-r--r-- 1 root root  175 May 17 23:14 fuzzystrmatch.control
>>> -rw-r--r-- 1 root root 1945 May 17 22:48 fuzzystrmatch--unpackaged--1.0.sql
>>> -rw-r--r-- 1 root root 1945 May 17 23:14 fuzzystrmatch--unpackaged--1.1.sql
>>>
>>> instead of:
>>>
>>> liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>> -rw-r--r-- 1 root root 30520 May 17 19:50
>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>
>>>
>>
>> The files will be copied to your pkglibdir path, which you can find by running pg_config --pkglibdir
>>
>
> pg_config
> You need to install postgresql-server-dev-X.Y for building a
> server-side extension or libpq-dev for building a client-side
> application.
>


(Please keep the list marked in your replies).

How did you install the Postgres instance you are trying to install the extension in? Did you use pre built binaries or
makeit from source? 

Regards,

Atri
>



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
<div class="moz-cite-prefix">On 5/18/2013 12:11 AM, Atri Sharma wrote:<br /></div><blockquote
cite="mid:123A01ED-4073-4389-ACA4-E58AFCA0BABE@gmail.com"type="cite"><pre wrap="">
 

Sent from my iPad

On 18-May-2013, at 12:34, Liming Hu <a class="moz-txt-link-rfc2396E"
href="mailto:dawninghu@gmail.com"><dawninghu@gmail.com></a>wrote:
 

</pre><blockquote type="cite"><pre wrap="">On Fri, May 17, 2013 at 11:44 PM, Atri Sharma <a
class="moz-txt-link-rfc2396E"href="mailto:atri.jiit@gmail.com"><atri.jiit@gmail.com></a> wrote:
 
</pre><blockquote type="cite"><pre wrap="">

Sent from my iPad

On 18-May-2013, at 12:07, Liming Hu <a class="moz-txt-link-rfc2396E"
href="mailto:dawninghu@gmail.com"><dawninghu@gmail.com></a>wrote:
 

</pre><blockquote type="cite"><pre wrap="">On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <a
class="moz-txt-link-rfc2396E"href="mailto:atri.jiit@gmail.com"><atri.jiit@gmail.com></a> wrote:
 
</pre><blockquote type="cite"><pre wrap="">

Sent from my iPad

On 18-May-2013, at 11:23, Liming Hu <a class="moz-txt-link-rfc2396E"
href="mailto:dawninghu@gmail.com"><dawninghu@gmail.com></a>wrote:
 

</pre><blockquote type="cite"><pre wrap="">On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <a
class="moz-txt-link-rfc2396E"href="mailto:atri.jiit@gmail.com"><atri.jiit@gmail.com></a> wrote:
 
</pre><blockquote type="cite"><pre wrap="">

Sent from my iPad

On 18-May-2013, at 10:41, Liming Hu <a class="moz-txt-link-rfc2396E"
href="mailto:dawninghu@gmail.com"><dawninghu@gmail.com></a>wrote:
 

</pre><blockquote type="cite"><pre wrap="">On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <a
class="moz-txt-link-rfc2396E"href="mailto:atri.jiit@gmail.com"><atri.jiit@gmail.com></a> wrote:
 
</pre><blockquote type="cite"><pre wrap="">

Sent from my iPad

On 18-May-2013, at 10:00, Liming Hu <a class="moz-txt-link-rfc2396E"
href="mailto:dawninghu@gmail.com"><dawninghu@gmail.com></a>wrote:
 

</pre><blockquote type="cite"><pre wrap="">On 5/17/2013 9:10 PM, Atri Sharma wrote:
</pre><blockquote type="cite"><pre wrap="">On Sat, May 18, 2013 at 9:27 AM, Liming Hu <a class="moz-txt-link-rfc2396E"
href="mailto:dawninghu@gmail.com"><dawninghu@gmail.com></a>wrote:
 
</pre><blockquote type="cite"><pre wrap="">On 5/17/2013 12:39 PM, Liming Hu wrote:
</pre><blockquote type="cite"><pre wrap="">On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <a
class="moz-txt-link-rfc2396E"href="mailto:josh@agliodbs.com"><josh@agliodbs.com></a> wrote:
 
</pre><blockquote type="cite"><blockquote type="cite"><pre wrap="">Can we add Levenshtein-Damerau edit distance since
itis used in
 
spelling checker
instead of levenshtein edit distance?
</pre></blockquote><pre wrap="">Patches welcome!  You, too, can be a PostgreSQL contributor.

However, you will need to preserve the ability of users to use the old
levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
be hard, just add a new function called levenshtiend().
</pre></blockquote><pre wrap="">I am working on it, I will make it this weekend project.
</pre></blockquote><pre wrap="">
I have done that. and put the code at github:
<a class="moz-txt-link-freetext"
href="https://github.com/liminghu/fuzzystrmatch">https://github.com/liminghu/fuzzystrmatch</a>

<a class="moz-txt-link-abbreviated"
href="mailto:liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$">liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$</a>
sudo cp fuzzystrmatch.so
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
<a class="moz-txt-link-abbreviated"
href="mailto:liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$">liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$</a>
sudo /etc/init.d/postgresql restart

* Restarting PostgreSQL 9.1 database server

[ OK ]


select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
CREATE EXTENSION fuzzystrmatch;

********** Error **********

ERROR: could not load library
"/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
damerau_levenshtein_internal_noncompatible

Any one can help me on this? Thanks.
</pre></blockquote><pre wrap="">The system is not able to find the required library, and I dont think
using cp to place the library is a very good idea.Did you run Make
Install after you added your work in the Makefile?
</pre></blockquote><pre wrap="">
I did not run make install. I am running a stable postgresql in my laptop, I do not
want to reinstall everything, just want to try this contribution.  I am afraid
reinstall it will destroy my configurations, and databases, just do not want to mess up.
did you see any thing wrong:
<a class="moz-txt-link-freetext"
href="https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql">https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql</a>
<a class="moz-txt-link-freetext"
href="https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql">https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql</a>
<a class="moz-txt-link-freetext"
href="https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c">https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c</a>
<a class="moz-txt-link-freetext"
href="https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c">https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c</a>
<a class="moz-txt-link-freetext"
href="https://github.com/liminghu/fuzzystrmatch/blob/master/">https://github.com/liminghu/fuzzystrmatch/blob/master/</a>
</pre></blockquote><pre wrap="">


You need not reinstall your entire database for installing/re installing an extension.Running make install from the
extension'sdirectory(after placing it in /contrib of a postgres database source directory) will install the extension
inyour current database without breaking anything.
 
</pre></blockquote><pre wrap="">
You mean:
<a class="moz-txt-link-abbreviated"
href="mailto:liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$">liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$</a>
make install
?
</pre></blockquote><pre wrap="">
Yes,although,I would run make clean before running make install,just for ensuring that all runs well.
</pre></blockquote><pre wrap="">
<a class="moz-txt-link-abbreviated"
href="mailto:liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$">liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$</a>
sudo make clean
rm -f fuzzystrmatch.so   libfuzzystrmatch.a
rm -f fuzzystrmatch.o dmetaphone.o
<a class="moz-txt-link-abbreviated"
href="mailto:liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$">liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$</a>
sudo make install
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wformat-security
-fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
-I../../src/include -D_GNU_SOURCE   -c -o fuzzystrmatch.o
fuzzystrmatch.c
In file included from fuzzystrmatch.c:250:0:
dameraulevenshtein.c: In function ‘damerau_levenshtein_internal’:
dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
[-Wunused-variable]
dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
[-Wunused-variable]
In file included from fuzzystrmatch.c:253:0:
dameraulevenshtein.c: In function ‘damerau_levenshtein_less_equal_internal’:
dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
[-Wunused-variable]
dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
[-Wunused-variable]
dameraulevenshtein.c: In function ‘dameraulevenshtein_with_costs_noncompatible’:
dameraulevenshtein.c:480:9: warning: ISO C90 forbids mixed
declarations and code [-Wdeclaration-after-statement]
dameraulevenshtein.c:494:10: warning: ISO C90 forbids mixed
declarations and code [-Wdeclaration-after-statement]
fuzzystrmatch.c: In function ‘damerau_levenshtein_with_costs_noncompatible’:
fuzzystrmatch.c:266:2: warning: implicit declaration of function
‘damerau_levenshtein_internal_noncompatible’
[-Wimplicit-function-declaration]
fuzzystrmatch.c: At top level:
dameraulevenshtein.c:40:12: warning: ‘dameraulevenshtein_internal’
declared ‘static’ but never defined [-Wunused-function]
dameraulevenshtein.c:37:12: warning:
‘dameraulevenshtein_less_equal_internal’ declared ‘static’ but never
defined [-Wunused-function]
dameraulevenshtein.c:464:12: warning:
‘dameraulevenshtein_with_costs_noncompatible’ defined but not used
[-Wunused-function]
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wformat-security
-fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
-I../../src/include -D_GNU_SOURCE   -c -o dmetaphone.o dmetaphone.c
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wformat-security
-fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -shared
-o fuzzystrmatch.so fuzzystrmatch.o dmetaphone.o -L../../src/port
-Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags
/bin/mkdir -p '/usr/local/pgsql/lib'
/bin/mkdir -p '/usr/local/pgsql/share/extension'
/bin/mkdir -p '/usr/local/pgsql/share/extension'
/bin/sh ../../config/install-sh -c -m 755  fuzzystrmatch.so
'/usr/local/pgsql/lib/fuzzystrmatch.so'
/bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch.control
'/usr/local/pgsql/share/extension/'
/bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch--1.0.sql
./fuzzystrmatch--unpackaged--1.0.sql
'/usr/local/pgsql/share/extension/'
<a class="moz-txt-link-abbreviated"
href="mailto:liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$">liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$</a>


After that:

CREATE EXTENSION fuzzystrmatch;
select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);




ERROR:  function dameraulevenshteinnocompatible(unknown, unknown,
integer, integer, integer, integer) does not exist
LINE 1: select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);           ^
HINT:  No function matches the given name and argument types. You
might need to add explicit type casts.


********** Error **********

ERROR: function dameraulevenshteinnocompatible(unknown, unknown,
integer, integer, integer, integer) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might
need to add explicit type casts.
Character: 8



</pre></blockquote><pre wrap="">
Ok,so now, we are in issues with the code and possibly, the configurations.

First up, I would fix the warnings
that are being generated while compiling.Those may lead to hard to detect errors later on.
</pre><blockquote type="cite"><pre wrap="">
</pre></blockquote><pre wrap="">
It seems that the functions you added are not being created in the database.Are you sure that you have modified the
.SQLfiles correctly to create you functions as well,and that you are using the correct SQL files while installing?
 

Does this happen only with dameraulevenshteinnocompatible, or with every function that you added? Have you tried using
oneof the original functions of fuzzystrmatch,to ensure that the original functionalities are still working?
 

</pre></blockquote><pre wrap="">

it seems the make install command will copy fuzzystrmatch.so to:
liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
total 48
drwxr-xr-x 2 root root  4096 May 17 23:14 .
drwxr-xr-x 4 root root  4096 May 17 22:39 ..
-rwxr-xr-x 1 root root 40640 May 17 23:14 fuzzystrmatch.so

liming@liming-UX31A:/usr/local/pgsql/share/extension$ ls -la
total 28
drwxr-xr-x 2 root root 4096 May 17 23:14 .
drwxr-xr-x 3 root root 4096 May 17 22:39 ..
-rw-r--r-- 1 root root 2250 May 17 22:48 fuzzystrmatch--1.0.sql
-rw-r--r-- 1 root root 2250 May 17 23:14 fuzzystrmatch--1.1.sql
-rw-r--r-- 1 root root  175 May 17 23:14 fuzzystrmatch.control
-rw-r--r-- 1 root root 1945 May 17 22:48 fuzzystrmatch--unpackaged--1.0.sql
-rw-r--r-- 1 root root 1945 May 17 23:14 fuzzystrmatch--unpackaged--1.1.sql

instead of:

liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
-rw-r--r-- 1 root root 30520 May 17 19:50
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so


</pre></blockquote><pre wrap="">
The files will be copied to your pkglibdir path, which you can find by running pg_config --pkglibdir

</pre></blockquote><pre wrap="">
pg_config
You need to install postgresql-server-dev-X.Y for building a
server-side extension or libpq-dev for building a client-side
application.

</pre></blockquote><pre wrap="">

(Please keep the list marked in your replies).

How did you install the Postgres instance you are trying to install the extension in? Did you use pre built binaries or
makeit from source?
 
</pre></blockquote><br /> I am running ubuntu, I install postgresql from the ubuntu software center.<br /> I directly
copythose files, now it works. <br /><br /><p style="margin:0in;font-family:consolas;font-size:11.0pt">select
dameraulevenshteinnocompatible('cta','cat',1,1,1,1);<p style="margin:0in;font-family:consolas;font-size:11.0pt"> <p
style="margin:0in;font-family:consolas;font-size:11.0pt">1<br/><p
style="margin:0in;font-family:consolas;font-size:11.0pt"><br/> thanks a lot.<br /><p
style="margin:0in;font-family:consolas;font-size:11.0pt">Liming<br/><br /><blockquote
cite="mid:123A01ED-4073-4389-ACA4-E58AFCA0BABE@gmail.com"type="cite"><pre wrap="">
 
Regards,

Atri
</pre><blockquote type="cite"><pre wrap="">
</pre></blockquote></blockquote><br />

Re: request a new feature in fuzzystrmatch

From
Atri Sharma
Date:
On Sat, May 18, 2013 at 1:30 PM, Liming Hu <dawninghu@gmail.com> wrote:
> On 5/18/2013 12:11 AM, Atri Sharma wrote:
>
> Sent from my iPad
>
> On 18-May-2013, at 12:34, Liming Hu <dawninghu@gmail.com> wrote:
>
> On Fri, May 17, 2013 at 11:44 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>
> Sent from my iPad
>
> On 18-May-2013, at 12:07, Liming Hu <dawninghu@gmail.com> wrote:
>
> On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>
> Sent from my iPad
>
> On 18-May-2013, at 11:23, Liming Hu <dawninghu@gmail.com> wrote:
>
> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>
> Sent from my iPad
>
> On 18-May-2013, at 10:41, Liming Hu <dawninghu@gmail.com> wrote:
>
> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>
> Sent from my iPad
>
> On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:
>
> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>
> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:
>
> On 5/17/2013 12:39 PM, Liming Hu wrote:
>
> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>
> Can we add Levenshtein-Damerau edit distance since it is used in
> spelling checker
> instead of levenshtein edit distance?
>
> Patches welcome!  You, too, can be a PostgreSQL contributor.
>
> However, you will need to preserve the ability of users to use the old
> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
> be hard, just add a new function called levenshtiend().
>
> I am working on it, I will make it this weekend project.
>
> I have done that. and put the code at github:
> https://github.com/liminghu/fuzzystrmatch
>
> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
> sudo cp fuzzystrmatch.so
> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
> sudo /etc/init.d/postgresql restart
>
> * Restarting PostgreSQL 9.1 database server
>
> [ OK ]
>
>
> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
> CREATE EXTENSION fuzzystrmatch;
>
> ********** Error **********
>
> ERROR: could not load library
> "/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
> damerau_levenshtein_internal_noncompatible
>
> Any one can help me on this? Thanks.
>
> The system is not able to find the required library, and I dont think
> using cp to place the library is a very good idea.Did you run Make
> Install after you added your work in the Makefile?
>
> I did not run make install. I am running a stable postgresql in my laptop, I
> do not
> want to reinstall everything, just want to try this contribution.  I am
> afraid
> reinstall it will destroy my configurations, and databases, just do not want
> to mess up.
> did you see any thing wrong:
> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
> https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
> https://github.com/liminghu/fuzzystrmatch/blob/master/
>
>
> You need not reinstall your entire database for installing/re installing an
> extension.Running make install from the extension's directory(after placing
> it in /contrib of a postgres database source directory) will install the
> extension in your current database without breaking anything.
>
> You mean:
> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
> make install
> ?
>
> Yes,although,I would run make clean before running make install,just for
> ensuring that all runs well.
>
> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
> sudo make clean
> rm -f fuzzystrmatch.so   libfuzzystrmatch.a
> rm -f fuzzystrmatch.o dmetaphone.o
> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
> sudo make install
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
> -I../../src/include -D_GNU_SOURCE   -c -o fuzzystrmatch.o
> fuzzystrmatch.c
> In file included from fuzzystrmatch.c:250:0:
> dameraulevenshtein.c: In function ‘damerau_levenshtein_internal’:
> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
> [-Wunused-variable]
> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
> [-Wunused-variable]
> In file included from fuzzystrmatch.c:253:0:
> dameraulevenshtein.c: In function ‘damerau_levenshtein_less_equal_internal’:
> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
> [-Wunused-variable]
> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
> [-Wunused-variable]
> dameraulevenshtein.c: In function
> ‘dameraulevenshtein_with_costs_noncompatible’:
> dameraulevenshtein.c:480:9: warning: ISO C90 forbids mixed
> declarations and code [-Wdeclaration-after-statement]
> dameraulevenshtein.c:494:10: warning: ISO C90 forbids mixed
> declarations and code [-Wdeclaration-after-statement]
> fuzzystrmatch.c: In function ‘damerau_levenshtein_with_costs_noncompatible’:
> fuzzystrmatch.c:266:2: warning: implicit declaration of function
> ‘damerau_levenshtein_internal_noncompatible’
> [-Wimplicit-function-declaration]
> fuzzystrmatch.c: At top level:
> dameraulevenshtein.c:40:12: warning: ‘dameraulevenshtein_internal’
> declared ‘static’ but never defined [-Wunused-function]
> dameraulevenshtein.c:37:12: warning:
> ‘dameraulevenshtein_less_equal_internal’ declared ‘static’ but never
> defined [-Wunused-function]
> dameraulevenshtein.c:464:12: warning:
> ‘dameraulevenshtein_with_costs_noncompatible’ defined but not used
> [-Wunused-function]
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
> -I../../src/include -D_GNU_SOURCE   -c -o dmetaphone.o dmetaphone.c
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -shared
> -o fuzzystrmatch.so fuzzystrmatch.o dmetaphone.o -L../../src/port
> -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags
> /bin/mkdir -p '/usr/local/pgsql/lib'
> /bin/mkdir -p '/usr/local/pgsql/share/extension'
> /bin/mkdir -p '/usr/local/pgsql/share/extension'
> /bin/sh ../../config/install-sh -c -m 755  fuzzystrmatch.so
> '/usr/local/pgsql/lib/fuzzystrmatch.so'
> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch.control
> '/usr/local/pgsql/share/extension/'
> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch--1.0.sql
> ./fuzzystrmatch--unpackaged--1.0.sql
> '/usr/local/pgsql/share/extension/'
> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>
>
> After that:
>
> CREATE EXTENSION fuzzystrmatch;
> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>
>
>
>
> ERROR:  function dameraulevenshteinnocompatible(unknown, unknown,
> integer, integer, integer, integer) does not exist
> LINE 1: select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>             ^
> HINT:  No function matches the given name and argument types. You
> might need to add explicit type casts.
>
>
> ********** Error **********
>
> ERROR: function dameraulevenshteinnocompatible(unknown, unknown,
> integer, integer, integer, integer) does not exist
> SQL state: 42883
> Hint: No function matches the given name and argument types. You might
> need to add explicit type casts.
> Character: 8
>
>
>
> Ok,so now, we are in issues with the code and possibly, the configurations.
>
> First up, I would fix the warnings
> that are being generated while compiling.Those may lead to hard to detect
> errors later on.
>
> It seems that the functions you added are not being created in the
> database.Are you sure that you have modified the .SQL files correctly to
> create you functions as well,and that you are using the correct SQL files
> while installing?
>
> Does this happen only with dameraulevenshteinnocompatible, or with every
> function that you added? Have you tried using one of the original functions
> of fuzzystrmatch,to ensure that the original functionalities are still
> working?
>
>
> it seems the make install command will copy fuzzystrmatch.so to:
> liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
> total 48
> drwxr-xr-x 2 root root  4096 May 17 23:14 .
> drwxr-xr-x 4 root root  4096 May 17 22:39 ..
> -rwxr-xr-x 1 root root 40640 May 17 23:14 fuzzystrmatch.so
>
> liming@liming-UX31A:/usr/local/pgsql/share/extension$ ls -la
> total 28
> drwxr-xr-x 2 root root 4096 May 17 23:14 .
> drwxr-xr-x 3 root root 4096 May 17 22:39 ..
> -rw-r--r-- 1 root root 2250 May 17 22:48 fuzzystrmatch--1.0.sql
> -rw-r--r-- 1 root root 2250 May 17 23:14 fuzzystrmatch--1.1.sql
> -rw-r--r-- 1 root root  175 May 17 23:14 fuzzystrmatch.control
> -rw-r--r-- 1 root root 1945 May 17 22:48 fuzzystrmatch--unpackaged--1.0.sql
> -rw-r--r-- 1 root root 1945 May 17 23:14 fuzzystrmatch--unpackaged--1.1.sql
>
> instead of:
>
> liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
> -rw-r--r-- 1 root root 30520 May 17 19:50
> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>
>
> The files will be copied to your pkglibdir path, which you can find by
> running pg_config --pkglibdir
>
> pg_config
> You need to install postgresql-server-dev-X.Y for building a
> server-side extension or libpq-dev for building a client-side
> application.
>
>
> (Please keep the list marked in your replies).
>
> How did you install the Postgres instance you are trying to install the
> extension in? Did you use pre built binaries or make it from source?
>
>
> I am running ubuntu, I install postgresql from the ubuntu software center.
> I directly copy those files, now it works.
>
> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>
>
>
> 1
>
>
> thanks a lot.
>
> Liming
>
>
> Regards,
>
> Atri
>
>

Awesome.

For reference, if you are using pre built binaries(as you are using),
you should install the client side applications and
postgresql-server-dev-X.Y as well.

Regards,

Atri
--
Regards,

Atri
l'apprenant



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On 5/18/2013 1:03 AM, Atri Sharma wrote:
> On Sat, May 18, 2013 at 1:30 PM, Liming Hu <dawninghu@gmail.com> wrote:
>> On 5/18/2013 12:11 AM, Atri Sharma wrote:
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 12:34, Liming Hu <dawninghu@gmail.com> wrote:
>>
>> On Fri, May 17, 2013 at 11:44 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 12:07, Liming Hu <dawninghu@gmail.com> wrote:
>>
>> On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 11:23, Liming Hu <dawninghu@gmail.com> wrote:
>>
>> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 10:41, Liming Hu <dawninghu@gmail.com> wrote:
>>
>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:
>>
>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>
>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:
>>
>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>
>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>>
>> Can we add Levenshtein-Damerau edit distance since it is used in
>> spelling checker
>> instead of levenshtein edit distance?
>>
>> Patches welcome!  You, too, can be a PostgreSQL contributor.
>>
>> However, you will need to preserve the ability of users to use the old
>> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
>> be hard, just add a new function called levenshtiend().
>>
>> I am working on it, I will make it this weekend project.
>>
>> I have done that. and put the code at github:
>> https://github.com/liminghu/fuzzystrmatch
>>
>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>> sudo cp fuzzystrmatch.so
>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>> sudo /etc/init.d/postgresql restart
>>
>> * Restarting PostgreSQL 9.1 database server
>>
>> [ OK ]
>>
>>
>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>> CREATE EXTENSION fuzzystrmatch;
>>
>> ********** Error **********
>>
>> ERROR: could not load library
>> "/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
>> damerau_levenshtein_internal_noncompatible
>>
>> Any one can help me on this? Thanks.
>>
>> The system is not able to find the required library, and I dont think
>> using cp to place the library is a very good idea.Did you run Make
>> Install after you added your work in the Makefile?
>>
>> I did not run make install. I am running a stable postgresql in my laptop, I
>> do not
>> want to reinstall everything, just want to try this contribution.  I am
>> afraid
>> reinstall it will destroy my configurations, and databases, just do not want
>> to mess up.
>> did you see any thing wrong:
>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
>> https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
>> https://github.com/liminghu/fuzzystrmatch/blob/master/
>>
>>
>> You need not reinstall your entire database for installing/re installing an
>> extension.Running make install from the extension's directory(after placing
>> it in /contrib of a postgres database source directory) will install the
>> extension in your current database without breaking anything.
>>
>> You mean:
>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>> make install
>> ?
>>
>> Yes,although,I would run make clean before running make install,just for
>> ensuring that all runs well.
>>
>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>> sudo make clean
>> rm -f fuzzystrmatch.so   libfuzzystrmatch.a
>> rm -f fuzzystrmatch.o dmetaphone.o
>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>> sudo make install
>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
>> -I../../src/include -D_GNU_SOURCE   -c -o fuzzystrmatch.o
>> fuzzystrmatch.c
>> In file included from fuzzystrmatch.c:250:0:
>> dameraulevenshtein.c: In function ‘damerau_levenshtein_internal’:
>> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
>> [-Wunused-variable]
>> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
>> [-Wunused-variable]
>> In file included from fuzzystrmatch.c:253:0:
>> dameraulevenshtein.c: In function ‘damerau_levenshtein_less_equal_internal’:
>> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
>> [-Wunused-variable]
>> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
>> [-Wunused-variable]
>> dameraulevenshtein.c: In function
>> ‘dameraulevenshtein_with_costs_noncompatible’:
>> dameraulevenshtein.c:480:9: warning: ISO C90 forbids mixed
>> declarations and code [-Wdeclaration-after-statement]
>> dameraulevenshtein.c:494:10: warning: ISO C90 forbids mixed
>> declarations and code [-Wdeclaration-after-statement]
>> fuzzystrmatch.c: In function ‘damerau_levenshtein_with_costs_noncompatible’:
>> fuzzystrmatch.c:266:2: warning: implicit declaration of function
>> ‘damerau_levenshtein_internal_noncompatible’
>> [-Wimplicit-function-declaration]
>> fuzzystrmatch.c: At top level:
>> dameraulevenshtein.c:40:12: warning: ‘dameraulevenshtein_internal’
>> declared ‘static’ but never defined [-Wunused-function]
>> dameraulevenshtein.c:37:12: warning:
>> ‘dameraulevenshtein_less_equal_internal’ declared ‘static’ but never
>> defined [-Wunused-function]
>> dameraulevenshtein.c:464:12: warning:
>> ‘dameraulevenshtein_with_costs_noncompatible’ defined but not used
>> [-Wunused-function]
>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
>> -I../../src/include -D_GNU_SOURCE   -c -o dmetaphone.o dmetaphone.c
>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -shared
>> -o fuzzystrmatch.so fuzzystrmatch.o dmetaphone.o -L../../src/port
>> -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags
>> /bin/mkdir -p '/usr/local/pgsql/lib'
>> /bin/mkdir -p '/usr/local/pgsql/share/extension'
>> /bin/mkdir -p '/usr/local/pgsql/share/extension'
>> /bin/sh ../../config/install-sh -c -m 755  fuzzystrmatch.so
>> '/usr/local/pgsql/lib/fuzzystrmatch.so'
>> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch.control
>> '/usr/local/pgsql/share/extension/'
>> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch--1.0.sql
>> ./fuzzystrmatch--unpackaged--1.0.sql
>> '/usr/local/pgsql/share/extension/'
>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>
>>
>> After that:
>>
>> CREATE EXTENSION fuzzystrmatch;
>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>
>>
>>
>>
>> ERROR:  function dameraulevenshteinnocompatible(unknown, unknown,
>> integer, integer, integer, integer) does not exist
>> LINE 1: select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>              ^
>> HINT:  No function matches the given name and argument types. You
>> might need to add explicit type casts.
>>
>>
>> ********** Error **********
>>
>> ERROR: function dameraulevenshteinnocompatible(unknown, unknown,
>> integer, integer, integer, integer) does not exist
>> SQL state: 42883
>> Hint: No function matches the given name and argument types. You might
>> need to add explicit type casts.
>> Character: 8
>>
>>
>>
>> Ok,so now, we are in issues with the code and possibly, the configurations.
>>
>> First up, I would fix the warnings
>> that are being generated while compiling.Those may lead to hard to detect
>> errors later on.
>>
>> It seems that the functions you added are not being created in the
>> database.Are you sure that you have modified the .SQL files correctly to
>> create you functions as well,and that you are using the correct SQL files
>> while installing?
>>
>> Does this happen only with dameraulevenshteinnocompatible, or with every
>> function that you added? Have you tried using one of the original functions
>> of fuzzystrmatch,to ensure that the original functionalities are still
>> working?
>>
>>
>> it seems the make install command will copy fuzzystrmatch.so to:
>> liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
>> total 48
>> drwxr-xr-x 2 root root  4096 May 17 23:14 .
>> drwxr-xr-x 4 root root  4096 May 17 22:39 ..
>> -rwxr-xr-x 1 root root 40640 May 17 23:14 fuzzystrmatch.so
>>
>> liming@liming-UX31A:/usr/local/pgsql/share/extension$ ls -la
>> total 28
>> drwxr-xr-x 2 root root 4096 May 17 23:14 .
>> drwxr-xr-x 3 root root 4096 May 17 22:39 ..
>> -rw-r--r-- 1 root root 2250 May 17 22:48 fuzzystrmatch--1.0.sql
>> -rw-r--r-- 1 root root 2250 May 17 23:14 fuzzystrmatch--1.1.sql
>> -rw-r--r-- 1 root root  175 May 17 23:14 fuzzystrmatch.control
>> -rw-r--r-- 1 root root 1945 May 17 22:48 fuzzystrmatch--unpackaged--1.0.sql
>> -rw-r--r-- 1 root root 1945 May 17 23:14 fuzzystrmatch--unpackaged--1.1.sql
>>
>> instead of:
>>
>> liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>> -rw-r--r-- 1 root root 30520 May 17 19:50
>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>
>>
>> The files will be copied to your pkglibdir path, which you can find by
>> running pg_config --pkglibdir
>>
>> pg_config
>> You need to install postgresql-server-dev-X.Y for building a
>> server-side extension or libpq-dev for building a client-side
>> application.
>>
>>
>> (Please keep the list marked in your replies).
>>
>> How did you install the Postgres instance you are trying to install the
>> extension in? Did you use pre built binaries or make it from source?
>>
>>
>> I am running ubuntu, I install postgresql from the ubuntu software center.
>> I directly copy those files, now it works.
>>
>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>
>>
>>
>> 1
>>
>>
>> thanks a lot.
>>
>> Liming
>>
>>
>> Regards,
>>
>> Atri
>>
>>
> Awesome.
>
> For reference, if you are using pre built binaries(as you are using),
> you should install the client side applications and
> postgresql-server-dev-X.Y as well.
>
> Regards,
>
> Atri
> --
> Regards,
>
> Atri
> l'apprenant
How to do that? Thanks.



Re: request a new feature in fuzzystrmatch

From
Atri Sharma
Date:
On Sat, May 18, 2013 at 1:47 PM, Liming Hu <dawninghu@gmail.com> wrote:
> On 5/18/2013 1:03 AM, Atri Sharma wrote:
>>
>> On Sat, May 18, 2013 at 1:30 PM, Liming Hu <dawninghu@gmail.com> wrote:
>>>
>>> On 5/18/2013 12:11 AM, Atri Sharma wrote:
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 12:34, Liming Hu <dawninghu@gmail.com> wrote:
>>>
>>> On Fri, May 17, 2013 at 11:44 PM, Atri Sharma <atri.jiit@gmail.com>
>>> wrote:
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 12:07, Liming Hu <dawninghu@gmail.com> wrote:
>>>
>>> On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <atri.jiit@gmail.com>
>>> wrote:
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 11:23, Liming Hu <dawninghu@gmail.com> wrote:
>>>
>>> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri.jiit@gmail.com>
>>> wrote:
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 10:41, Liming Hu <dawninghu@gmail.com> wrote:
>>>
>>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 10:00, Liming Hu <dawninghu@gmail.com> wrote:
>>>
>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>
>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu@gmail.com> wrote:
>>>
>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>
>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
>>>
>>> Can we add Levenshtein-Damerau edit distance since it is used in
>>> spelling checker
>>> instead of levenshtein edit distance?
>>>
>>> Patches welcome!  You, too, can be a PostgreSQL contributor.
>>>
>>> However, you will need to preserve the ability of users to use the old
>>> levenshtien algorithm as well, for backwards-compatibility.  Shouldn't
>>> be hard, just add a new function called levenshtiend().
>>>
>>> I am working on it, I will make it this weekend project.
>>>
>>> I have done that. and put the code at github:
>>> https://github.com/liminghu/fuzzystrmatch
>>>
>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>> sudo cp fuzzystrmatch.so
>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>> sudo /etc/init.d/postgresql restart
>>>
>>> * Restarting PostgreSQL 9.1 database server
>>>
>>> [ OK ]
>>>
>>>
>>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>> CREATE EXTENSION fuzzystrmatch;
>>>
>>> ********** Error **********
>>>
>>> ERROR: could not load library
>>> "/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so":
>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so: undefined symbol:
>>> damerau_levenshtein_internal_noncompatible
>>>
>>> Any one can help me on this? Thanks.
>>>
>>> The system is not able to find the required library, and I dont think
>>> using cp to place the library is a very good idea.Did you run Make
>>> Install after you added your work in the Makefile?
>>>
>>> I did not run make install. I am running a stable postgresql in my
>>> laptop, I
>>> do not
>>> want to reinstall everything, just want to try this contribution.  I am
>>> afraid
>>> reinstall it will destroy my configurations, and databases, just do not
>>> want
>>> to mess up.
>>> did you see any thing wrong:
>>>
>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--1.0.sql
>>>
>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch--unpackaged--1.0.sql
>>> https://github.com/liminghu/fuzzystrmatch/blob/master/fuzzystrmatch.c
>>>
>>> https://github.com/liminghu/fuzzystrmatch/blob/master/dameraulevenshtein.c
>>> https://github.com/liminghu/fuzzystrmatch/blob/master/
>>>
>>>
>>> You need not reinstall your entire database for installing/re installing
>>> an
>>> extension.Running make install from the extension's directory(after
>>> placing
>>> it in /contrib of a postgres database source directory) will install the
>>> extension in your current database without breaking anything.
>>>
>>> You mean:
>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>> make install
>>> ?
>>>
>>> Yes,although,I would run make clean before running make install,just for
>>> ensuring that all runs well.
>>>
>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>> sudo make clean
>>> rm -f fuzzystrmatch.so   libfuzzystrmatch.a
>>> rm -f fuzzystrmatch.o dmetaphone.o
>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>> sudo make install
>>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
>>> -I../../src/include -D_GNU_SOURCE   -c -o fuzzystrmatch.o
>>> fuzzystrmatch.c
>>> In file included from fuzzystrmatch.c:250:0:
>>> dameraulevenshtein.c: In function ‘damerau_levenshtein_internal’:
>>> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
>>> [-Wunused-variable]
>>> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
>>> [-Wunused-variable]
>>> In file included from fuzzystrmatch.c:253:0:
>>> dameraulevenshtein.c: In function
>>> ‘damerau_levenshtein_less_equal_internal’:
>>> dameraulevenshtein.c:290:57: warning: unused variable ‘trans’
>>> [-Wunused-variable]
>>> dameraulevenshtein.c:328:57: warning: unused variable ‘trans’
>>> [-Wunused-variable]
>>> dameraulevenshtein.c: In function
>>> ‘dameraulevenshtein_with_costs_noncompatible’:
>>> dameraulevenshtein.c:480:9: warning: ISO C90 forbids mixed
>>> declarations and code [-Wdeclaration-after-statement]
>>> dameraulevenshtein.c:494:10: warning: ISO C90 forbids mixed
>>> declarations and code [-Wdeclaration-after-statement]
>>> fuzzystrmatch.c: In function
>>> ‘damerau_levenshtein_with_costs_noncompatible’:
>>> fuzzystrmatch.c:266:2: warning: implicit declaration of function
>>> ‘damerau_levenshtein_internal_noncompatible’
>>> [-Wimplicit-function-declaration]
>>> fuzzystrmatch.c: At top level:
>>> dameraulevenshtein.c:40:12: warning: ‘dameraulevenshtein_internal’
>>> declared ‘static’ but never defined [-Wunused-function]
>>> dameraulevenshtein.c:37:12: warning:
>>> ‘dameraulevenshtein_less_equal_internal’ declared ‘static’ but never
>>> defined [-Wunused-function]
>>> dameraulevenshtein.c:464:12: warning:
>>> ‘dameraulevenshtein_with_costs_noncompatible’ defined but not used
>>> [-Wunused-function]
>>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I.
>>> -I../../src/include -D_GNU_SOURCE   -c -o dmetaphone.o dmetaphone.c
>>> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
>>> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
>>> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -shared
>>> -o fuzzystrmatch.so fuzzystrmatch.o dmetaphone.o -L../../src/port
>>> -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags
>>> /bin/mkdir -p '/usr/local/pgsql/lib'
>>> /bin/mkdir -p '/usr/local/pgsql/share/extension'
>>> /bin/mkdir -p '/usr/local/pgsql/share/extension'
>>> /bin/sh ../../config/install-sh -c -m 755  fuzzystrmatch.so
>>> '/usr/local/pgsql/lib/fuzzystrmatch.so'
>>> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch.control
>>> '/usr/local/pgsql/share/extension/'
>>> /bin/sh ../../config/install-sh -c -m 644 ./fuzzystrmatch--1.0.sql
>>> ./fuzzystrmatch--unpackaged--1.0.sql
>>> '/usr/local/pgsql/share/extension/'
>>> liming@liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>
>>>
>>> After that:
>>>
>>> CREATE EXTENSION fuzzystrmatch;
>>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>
>>>
>>>
>>>
>>> ERROR:  function dameraulevenshteinnocompatible(unknown, unknown,
>>> integer, integer, integer, integer) does not exist
>>> LINE 1: select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>              ^
>>> HINT:  No function matches the given name and argument types. You
>>> might need to add explicit type casts.
>>>
>>>
>>> ********** Error **********
>>>
>>> ERROR: function dameraulevenshteinnocompatible(unknown, unknown,
>>> integer, integer, integer, integer) does not exist
>>> SQL state: 42883
>>> Hint: No function matches the given name and argument types. You might
>>> need to add explicit type casts.
>>> Character: 8
>>>
>>>
>>>
>>> Ok,so now, we are in issues with the code and possibly, the
>>> configurations.
>>>
>>> First up, I would fix the warnings
>>> that are being generated while compiling.Those may lead to hard to detect
>>> errors later on.
>>>
>>> It seems that the functions you added are not being created in the
>>> database.Are you sure that you have modified the .SQL files correctly to
>>> create you functions as well,and that you are using the correct SQL files
>>> while installing?
>>>
>>> Does this happen only with dameraulevenshteinnocompatible, or with every
>>> function that you added? Have you tried using one of the original
>>> functions
>>> of fuzzystrmatch,to ensure that the original functionalities are still
>>> working?
>>>
>>>
>>> it seems the make install command will copy fuzzystrmatch.so to:
>>> liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
>>> total 48
>>> drwxr-xr-x 2 root root  4096 May 17 23:14 .
>>> drwxr-xr-x 4 root root  4096 May 17 22:39 ..
>>> -rwxr-xr-x 1 root root 40640 May 17 23:14 fuzzystrmatch.so
>>>
>>> liming@liming-UX31A:/usr/local/pgsql/share/extension$ ls -la
>>> total 28
>>> drwxr-xr-x 2 root root 4096 May 17 23:14 .
>>> drwxr-xr-x 3 root root 4096 May 17 22:39 ..
>>> -rw-r--r-- 1 root root 2250 May 17 22:48 fuzzystrmatch--1.0.sql
>>> -rw-r--r-- 1 root root 2250 May 17 23:14 fuzzystrmatch--1.1.sql
>>> -rw-r--r-- 1 root root  175 May 17 23:14 fuzzystrmatch.control
>>> -rw-r--r-- 1 root root 1945 May 17 22:48
>>> fuzzystrmatch--unpackaged--1.0.sql
>>> -rw-r--r-- 1 root root 1945 May 17 23:14
>>> fuzzystrmatch--unpackaged--1.1.sql
>>>
>>> instead of:
>>>
>>> liming@liming-UX31A:/usr/local/pgsql/lib$ ls -la
>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>> -rw-r--r-- 1 root root 30520 May 17 19:50
>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>
>>>
>>> The files will be copied to your pkglibdir path, which you can find by
>>> running pg_config --pkglibdir
>>>
>>> pg_config
>>> You need to install postgresql-server-dev-X.Y for building a
>>> server-side extension or libpq-dev for building a client-side
>>> application.
>>>
>>>
>>> (Please keep the list marked in your replies).
>>>
>>> How did you install the Postgres instance you are trying to install the
>>> extension in? Did you use pre built binaries or make it from source?
>>>
>>>
>>> I am running ubuntu, I install postgresql from the ubuntu software
>>> center.
>>> I directly copy those files, now it works.
>>>
>>> select dameraulevenshteinnocompatible('cta', 'cat',1,1,1,1);
>>>
>>>
>>>
>>> 1
>>>
>>>
>>> thanks a lot.
>>>
>>> Liming
>>>
>>>
>>> Regards,
>>>
>>> Atri
>>>
>>>
>> Awesome.
>>
>> For reference, if you are using pre built binaries(as you are using),
>> you should install the client side applications and
>> postgresql-server-dev-X.Y as well.
>>
>> Regards,
>>
>> Atri
>> --
>> Regards,
>>
>> Atri
>> l'apprenant
>
> How to do that? Thanks.

Directly from sudo apt-get.

e.g. sudo apt-get install postgresql-server-dev-9.2

Or,you could probably search for them in Ubuntu Software Center.

Regards,

Atri

--
Regards,

Atri
l'apprenant



Re: request a new feature in fuzzystrmatch

From
David Fetter
Date:
On Fri, May 17, 2013 at 05:50:38PM +0200, Cédric Villemain wrote:
> Hello Liming,
>
> > >> Sounds interesting. How can we build this over our current
> > >> implementation, or do we need to build it from scratch?
> > >>
> > > I know how to write the code, but just need approval of accepting into
> > > the new version.
> >
> > Well, acceptance depends largely on the implementation and actual
> > benefit statistics. I would suggest implementing a basic version and
> > then demonstrating its potential benefits here. It will lead to
> > clearer ideas for us and lead to improvements in the implementation.
>
> You can have a look at this page:
> http://wiki.postgresql.org/wiki/Submitting_a_Patch

Also very important to look at for patch implementation and
communication:

http://wiki.postgresql.org/wiki/Working_with_Git

Cheers,
David (wondering whether we should provide specific instructions for
github, bitbucket, etc.).
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On Sat, May 18, 2013 at 6:38 PM, David Fetter <david@fetter.org> wrote:
> On Fri, May 17, 2013 at 05:50:38PM +0200, Cédric Villemain wrote:
>> Hello Liming,
>>
>> > >> Sounds interesting. How can we build this over our current
>> > >> implementation, or do we need to build it from scratch?
>> > >>
>> > > I know how to write the code, but just need approval of accepting into
>> > > the new version.
>> >
>> > Well, acceptance depends largely on the implementation and actual
>> > benefit statistics. I would suggest implementing a basic version and
>> > then demonstrating its potential benefits here. It will lead to
>> > clearer ideas for us and lead to improvements in the implementation.
>>
>> You can have a look at this page:
>> http://wiki.postgresql.org/wiki/Submitting_a_Patch
>
> Also very important to look at for patch implementation and
> communication:
>
> http://wiki.postgresql.org/wiki/Working_with_Git
>
> Cheers,
> David (wondering whether we should provide specific instructions for
> github, bitbucket, etc.).

I have implemented the code according to Joe's suggestion, and put the code at:
https://github.com/liminghu/fuzzystrmatch/tree/fuzzystrmatchv1.1

Thanks,

Liming
> --
> David Fetter <david@fetter.org> http://fetter.org/
> Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
> Skype: davidfetter      XMPP: david.fetter@gmail.com
> iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/donate



--
Liming Hu
cell: (435)-512-4190
Seattle Washington



Re: request a new feature in fuzzystrmatch

From
Alvaro Herrera
Date:
Liming Hu escribió:

> I have implemented the code according to Joe's suggestion, and put the code at:
> https://github.com/liminghu/fuzzystrmatch/tree/fuzzystrmatchv1.1

Please submit a proper patch so it can be seen on our mailing list
archives.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On Tue, Jun 11, 2013 at 1:57 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Liming Hu escribió:
>
>> I have implemented the code according to Joe's suggestion, and put the code at:
>> https://github.com/liminghu/fuzzystrmatch/tree/fuzzystrmatchv1.1
>
> Please submit a proper patch so it can be seen on our mailing list
> archives.
>
Hi Alvaro,

I am kind of new to the Postgresql hacker community, Can you please
help me on submit the
patch?

Thanks,

Liming
> --
> Álvaro Herrera                http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services



--
Liming Hu
cell: (435)-512-4190
Seattle Washington



Re: request a new feature in fuzzystrmatch

From
Kevin Grittner
Date:
Liming Hu <dawninghu@gmail.com> wrote:

> I am kind of new to the Postgresql hacker community, Can you
> please help me on submit the patch?

You might want to read this page:

http://wiki.postgresql.org/wiki/Developer_FAQ

In particular, the Development Process section has a link to
"Submitting a Patch" that you should read.

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: request a new feature in fuzzystrmatch

From
Joe Conway
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/11/2013 02:23 PM, Liming Hu wrote:
> On Tue, Jun 11, 2013 at 1:57 PM, Alvaro Herrera 
> <alvherre@2ndquadrant.com> wrote:
>> Liming Hu escribió:
>> 
>>> I have implemented the code according to Joe's suggestion, and
>>> put the code at: 
>>> https://github.com/liminghu/fuzzystrmatch/tree/fuzzystrmatchv1.1
>>
>>
>>> 
Please submit a proper patch so it can be seen on our mailing list
>> archives.
>> 
> Hi Alvaro,
> 
> I am kind of new to the Postgresql hacker community, Can you
> please help me on submit the patch?

Hi Liming,

I might be able to help, but it will be at least a couple of days
before I have the time to look at this,

Joe


- -- 
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRt50oAAoJEDfy90M199hliukP/A8IZf7L0DcYWG/jZUttTg0M
yWpCz1KHZ7fAGqeJ5ddzuSx5CMjsmt2zYQ+0EfLX1ftoSxIHaFpSC49GgJHUdAoq
TSOOC1rfkfmNJG98WfUPH14Flq4eEl9reUZDXXi3jqol+npJdAQaEt9EM5y0qkcB
pDCy9iMaYdjYNV6RXFOBNI+7Up43oULbMLhWwwFnGX9AgCLk8SGRZHnfT1zOaXYE
bW/Dl9TIu058ENZqFFLIfjxqngE/Y61SOaLRAxEkbO7HAFkuwgQwnIayrasR29F+
GX4+HRcsd0jrcF858Dm4E+YAffI2quOR2HgZTGQj6jTNtRpb16+EI+X1vrYI3AH8
5tf3exq9FDL/02zlCpKm8+uXksaLzffQXlbQPw8uDlpk+ThD0uo2990/TC6QYgXO
o2vCu+nkWdTc2AUk4NkoVFwXaaFLZ+M8U+swRHNAShqH7VQVx8rRwubsRJ1msT3i
nC8BFyMsBzOmsKNwO0IM6ZcsJXaIpmMCUshF8cGDfgpsWUQ/wzovzopb+PSiEKQB
X45hWYtiK3tIvo0f9gvEWzRJ4+O8tmmIZzzWz127yBdugV0xjsEHnDihpjkeMPJx
WHs5ViN62u62r34UCtX1oiClCC+FYR0f//alh48VlXWzP7NkFt4dcKOD6ZCzSOeQ
udKM0QF2TNbUebj9QIpq
=W6Oy
-----END PGP SIGNATURE-----



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On Tue, Jun 11, 2013 at 2:56 PM, Joe Conway <mail@joeconway.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 06/11/2013 02:23 PM, Liming Hu wrote:
>> On Tue, Jun 11, 2013 at 1:57 PM, Alvaro Herrera
>> <alvherre@2ndquadrant.com> wrote:
>>> Liming Hu escribió:
>>>
>>>> I have implemented the code according to Joe's suggestion, and
>>>> put the code at:
>>>> https://github.com/liminghu/fuzzystrmatch/tree/fuzzystrmatchv1.1
>>>
>>>
>>>>
> Please submit a proper patch so it can be seen on our mailing list
>>> archives.
>>>
>> Hi Alvaro,
>>
>> I am kind of new to the Postgresql hacker community, Can you
>> please help me on submit the patch?
>
> Hi Liming,
>
> I might be able to help, but it will be at least a couple of days
> before I have the time to look at this,
>
> Joe
>
>
ok, thanks, I will wait.

Liming
> - --
> Joe Conway
> credativ LLC: http://www.credativ.us
> Linux, PostgreSQL, and general Open Source
> Training, Service, Consulting, & 24x7 Support
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBAgAGBQJRt50oAAoJEDfy90M199hliukP/A8IZf7L0DcYWG/jZUttTg0M
> yWpCz1KHZ7fAGqeJ5ddzuSx5CMjsmt2zYQ+0EfLX1ftoSxIHaFpSC49GgJHUdAoq
> TSOOC1rfkfmNJG98WfUPH14Flq4eEl9reUZDXXi3jqol+npJdAQaEt9EM5y0qkcB
> pDCy9iMaYdjYNV6RXFOBNI+7Up43oULbMLhWwwFnGX9AgCLk8SGRZHnfT1zOaXYE
> bW/Dl9TIu058ENZqFFLIfjxqngE/Y61SOaLRAxEkbO7HAFkuwgQwnIayrasR29F+
> GX4+HRcsd0jrcF858Dm4E+YAffI2quOR2HgZTGQj6jTNtRpb16+EI+X1vrYI3AH8
> 5tf3exq9FDL/02zlCpKm8+uXksaLzffQXlbQPw8uDlpk+ThD0uo2990/TC6QYgXO
> o2vCu+nkWdTc2AUk4NkoVFwXaaFLZ+M8U+swRHNAShqH7VQVx8rRwubsRJ1msT3i
> nC8BFyMsBzOmsKNwO0IM6ZcsJXaIpmMCUshF8cGDfgpsWUQ/wzovzopb+PSiEKQB
> X45hWYtiK3tIvo0f9gvEWzRJ4+O8tmmIZzzWz127yBdugV0xjsEHnDihpjkeMPJx
> WHs5ViN62u62r34UCtX1oiClCC+FYR0f//alh48VlXWzP7NkFt4dcKOD6ZCzSOeQ
> udKM0QF2TNbUebj9QIpq
> =W6Oy
> -----END PGP SIGNATURE-----



--
Liming Hu
cell: (435)-512-4190
Seattle Washington



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On Tue, Jun 11, 2013 at 3:19 PM, Liming Hu <dawninghu@gmail.com> wrote:
> On Tue, Jun 11, 2013 at 2:56 PM, Joe Conway <mail@joeconway.com> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 06/11/2013 02:23 PM, Liming Hu wrote:
>>> On Tue, Jun 11, 2013 at 1:57 PM, Alvaro Herrera
>>> <alvherre@2ndquadrant.com> wrote:
>>>> Liming Hu escribió:
>>>>
>>>>> I have implemented the code according to Joe's suggestion, and
>>>>> put the code at:
>>>>> https://github.com/liminghu/fuzzystrmatch/tree/fuzzystrmatchv1.1
>>>>
>>>>
>>>>>
>> Please submit a proper patch so it can be seen on our mailing list
>>>> archives.
>>>>
>>> Hi Alvaro,
>>>
>>> I am kind of new to the Postgresql hacker community, Can you
>>> please help me on submit the patch?
>>
>> Hi Liming,
>>
>> I might be able to help, but it will be at least a couple of days
>> before I have the time to look at this,
>>
>> Joe
>>
>>
> ok, thanks, I will wait.
Hi Joe,

Do you have some time in the weekend to help me submit the patch?
Thanks,

Liming
>
> Liming
>> - --
>> Joe Conway
>> credativ LLC: http://www.credativ.us
>> Linux, PostgreSQL, and general Open Source
>> Training, Service, Consulting, & 24x7 Support
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.12 (GNU/Linux)
>> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>>
>> iQIcBAEBAgAGBQJRt50oAAoJEDfy90M199hliukP/A8IZf7L0DcYWG/jZUttTg0M
>> yWpCz1KHZ7fAGqeJ5ddzuSx5CMjsmt2zYQ+0EfLX1ftoSxIHaFpSC49GgJHUdAoq
>> TSOOC1rfkfmNJG98WfUPH14Flq4eEl9reUZDXXi3jqol+npJdAQaEt9EM5y0qkcB
>> pDCy9iMaYdjYNV6RXFOBNI+7Up43oULbMLhWwwFnGX9AgCLk8SGRZHnfT1zOaXYE
>> bW/Dl9TIu058ENZqFFLIfjxqngE/Y61SOaLRAxEkbO7HAFkuwgQwnIayrasR29F+
>> GX4+HRcsd0jrcF858Dm4E+YAffI2quOR2HgZTGQj6jTNtRpb16+EI+X1vrYI3AH8
>> 5tf3exq9FDL/02zlCpKm8+uXksaLzffQXlbQPw8uDlpk+ThD0uo2990/TC6QYgXO
>> o2vCu+nkWdTc2AUk4NkoVFwXaaFLZ+M8U+swRHNAShqH7VQVx8rRwubsRJ1msT3i
>> nC8BFyMsBzOmsKNwO0IM6ZcsJXaIpmMCUshF8cGDfgpsWUQ/wzovzopb+PSiEKQB
>> X45hWYtiK3tIvo0f9gvEWzRJ4+O8tmmIZzzWz127yBdugV0xjsEHnDihpjkeMPJx
>> WHs5ViN62u62r34UCtX1oiClCC+FYR0f//alh48VlXWzP7NkFt4dcKOD6ZCzSOeQ
>> udKM0QF2TNbUebj9QIpq
>> =W6Oy
>> -----END PGP SIGNATURE-----
>
>
>
> --
> Liming Hu
> cell: (435)-512-4190
> Seattle Washington



--
Liming Hu
cell: (435)-512-4190
Seattle Washington



Re: request a new feature in fuzzystrmatch

From
David Fetter
Date:
On Fri, Jun 14, 2013 at 10:08:24AM -0700, Liming Hu wrote:
> On Tue, Jun 11, 2013 at 3:19 PM, Liming Hu <dawninghu@gmail.com> wrote:
> > On Tue, Jun 11, 2013 at 2:56 PM, Joe Conway <mail@joeconway.com> wrote:
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> On 06/11/2013 02:23 PM, Liming Hu wrote:
> >>> On Tue, Jun 11, 2013 at 1:57 PM, Alvaro Herrera
> >>> <alvherre@2ndquadrant.com> wrote:
> >>>> Liming Hu escribió:
> >>>>
> >>>>> I have implemented the code according to Joe's suggestion, and
> >>>>> put the code at:
> >>>>> https://github.com/liminghu/fuzzystrmatch/tree/fuzzystrmatchv1.1
> >>>>
> >>>>
> >>>>>
> >> Please submit a proper patch so it can be seen on our mailing list
> >>>> archives.
> >>>>
> >>> Hi Alvaro,
> >>>
> >>> I am kind of new to the Postgresql hacker community, Can you
> >>> please help me on submit the patch?
> >>
> >> Hi Liming,
> >>
> >> I might be able to help, but it will be at least a couple of days
> >> before I have the time to look at this,
> >>
> >> Joe
> >>
> >>
> > ok, thanks, I will wait.
> Hi Joe,
> 
> Do you have some time in the weekend to help me submit the patch?
> Thanks,
> 
> Liming

Liming,

Is your git skill good enough to create a patch vs. PostgreSQL's git
master?  If so, send that and once it's hit the mailing list, record
same on commitfest.postgresql.org in the current open commitfest.  If
not, let us know where in that process you got stuck.

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate



Re: request a new feature in fuzzystrmatch

From
"Joshua D. Drake"
Date:
On 06/14/2013 10:11 AM, David Fetter wrote:

>>> ok, thanks, I will wait.
>> Hi Joe,
>>
>> Do you have some time in the weekend to help me submit the patch?
>> Thanks,
>>
>> Liming
>
> Liming,
>
> Is your git skill good enough to create a patch vs. PostgreSQL's git
> master?  If so, send that and once it's hit the mailing list, record
> same on commitfest.postgresql.org in the current open commitfest.  If
> not, let us know where in that process you got stuck.
>
> Cheers,
> David.
>

This sounds like a wiki page FAQ in the making.

JD

-- 
Command Prompt, Inc. - http://www.commandprompt.com/  509-416-6579
PostgreSQL Support, Training, Professional Services and Development
High Availability, Oracle Conversion, Postgres-XC, @cmdpromptinc
For my dreams of your image that blossoms   a rose in the deeps of my heart. - W.B. Yeats



Re: request a new feature in fuzzystrmatch

From
David Fetter
Date:
On Fri, Jun 14, 2013 at 10:14:14AM -0700, Joshua D. Drake wrote:
> On 06/14/2013 10:11 AM, David Fetter wrote:
> 
> >>>ok, thanks, I will wait.
> >>Hi Joe,
> >>
> >>Do you have some time in the weekend to help me submit the patch?
> >>Thanks,
> >>
> >>Liming
> >
> >Liming,
> >
> >Is your git skill good enough to create a patch vs. PostgreSQL's git
> >master?  If so, send that and once it's hit the mailing list, record
> >same on commitfest.postgresql.org in the current open commitfest.  If
> >not, let us know where in that process you got stuck.
> >
> 
> This sounds like a wiki page FAQ in the making.

With utmost respect, this sounds like several pages should be
consolidated into one and clarified.  Yet another page will just make
matters more confusing.

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate



Re: request a new feature in fuzzystrmatch

From
Josh Berkus
Date:
Liming,

I'm putting this in the commitfest regardless, so that it at least gets
a review.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



Re: request a new feature in fuzzystrmatch

From
Josh Berkus
Date:
Liming,

I've added your proposal in to the commitfest so that you can get a
review this commitfest.  However, you need to generate a context diff
and submit it to this mailing list for it to really get reviewed.
That's a requirement.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On 6/15/2013 9:51 PM, Josh Berkus wrote:
> Liming,
>
> I've added your proposal in to the commitfest so that you can get a
> review this commitfest.  However, you need to generate a context diff
> and submit it to this mailing list for it to really get reviewed.
> That's a requirement.
>
Hi Josh,

Thanks. Where can I see the "proposal"? Thanks.

Liming



Re: request a new feature in fuzzystrmatch

From
Joe Conway
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/14/2013 12:08 PM, Liming Hu wrote:
>>>>>>> I have implemented the code according to Joe's
>>>>>>> suggestion, and put the code at:
>>>>>>> https://github.com/liminghu/fuzzystrmatch/tree/fuzzystrmatchv1.1
>>>>>>>
>
>>>>>>>
Please submit a proper patch so it can be seen on our mailing list
>>>>>> archives.
>>>>>>
>>>>> Hi Alvaro,
>>>>>
>>>>> I am kind of new to the Postgresql hacker community, Can
>>>>> you please help me on submit the patch?

I have not done much in the way of real review yet, but here at least
is a context diff against git master.

Joe


- --
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQIcBAEBAgAGBQJRyOw2AAoJEDfy90M199hlFhEP/2o/d08Fq4CHA9iI05PxDwQM
AHF6PWS5gJToNLtiTevyEamWyzlULjX3yJ9gTAhxc+ltxE9Xuf3/bfMcJQSbJ5c9
6GSH7CWpaY1DpfAwvYiwTJ9EPBZ11u8VZaMrb1VU2DS8rioOOL3llzpk+D6/1no5
y327vlH1aOuqk3Hwu0c/WN8RAcf1HLbhafph2KruUfr/ba3uILBQZtzpyK4uCDew
OJA+cktXHv3ho7w4N//xVQs3sZ/EoLahOt/y4syd3dN+Cq/8kj/uJaVgT2QY8rDQ
HIBpYvm+b3DsYpjw2qrSVBriIupF2a0UPkLfC5cu3om8VvBilShydE6uTI+f+55p
a12NuzepwgDnpZ1jOZkkmnBslpfoZI9TEo1UDeZ8x/TSZDW72FhwRtWq9kO9CFIK
cJvG9B9E5zhyZx9V1C2S0qpvIJAj/Gns4ymvYU1lm5UUnpPSpTQoUK8ybrfnHoTE
B0DEVjqxbrk9SSJ5LI3KojAaSMUIQDcjMQFCsghR1s5/yRhpZ7xEPvcL63ARwDcv
ZeeL6r5G+nmKAfRAjGbmWi/Y1ANI0ucO5XxnfhSDb+TCQow4U6IgNvkYjN1hTNEI
//9mQHDHi5qsuGcRcgvFLLeR4eVSGewseYLOR9XELMYTam4IUClwPr6WHuMqE/aE
jvMZafqZ/1EhQ2SeqCo4
=wcGM
-----END PGP SIGNATURE-----

Attachment

Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On Mon, Jun 24, 2013 at 6:02 PM, Joe Conway <mail@joeconway.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 06/14/2013 12:08 PM, Liming Hu wrote:
>>>>>>>> I have implemented the code according to Joe's
>>>>>>>> suggestion, and put the code at:
>>>>>>>> https://github.com/liminghu/fuzzystrmatch/tree/fuzzystrmatchv1.1
>>>>>>>>
>>
>>>>>>>>
> Please submit a proper patch so it can be seen on our mailing list
>>>>>>> archives.
>>>>>>>
>>>>>> Hi Alvaro,
>>>>>>
>>>>>> I am kind of new to the Postgresql hacker community, Can
>>>>>> you please help me on submit the patch?
>
> I have not done much in the way of real review yet, but here at least
> is a context diff against git master.
>
> Joe
>
Hi Joe,

Thanks a lot.

please remove "dameraulevenshteinnocompatible" related stuff, I just
followed the template you created.
"dameraulevenshteinnocompatible" was used in my first testing.

diff -cNr /opt/src/pgsql-git/master/contrib/fuzzystrmatch/fuzzystrmatch--1.0.sql
fuzzystrmatch/fuzzystrmatch--1.0.sql
*** /opt/src/pgsql-git/master/contrib/fuzzystrmatch/fuzzystrmatch--1.0.sql
2012-02-25 20:24:23.000000000 -0600
--- fuzzystrmatch/fuzzystrmatch--1.0.sql 2013-06-11 04:09:01.000000000 -0500
CREATE FUNCTION dameraulevenshteinnocompatible
(text,text,int,int,int,int) RETURNS int
+ AS 'MODULE_PATHNAME','dameraulevenshtein_with_costs_noncompatible'
+ LANGUAGE C IMMUTABLE STRICT;


please remove "dameraulevenshteinnocompatible" related stuff, I just
followed the template you created.
"dameraulevenshteinnocompatible" was used in my first testing.

diff -cNr /opt/src/pgsql-git/master/contrib/fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql
fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql
*** /opt/src/pgsql-git/master/contrib/fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql
2012-02-25 20:24:23.000000000 -0600
--- fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql 2013-06-11
04:09:01.000000000 -0500

+ ALTER EXTENSION fuzzystrmatch ADD function
dameraulevenshteinnoncompatible(text,text,integer,integer,integer,integer);

+CREATE FUNCTION dameraulevenshtein_less_equal_noncompatible
(text,text,int,int,int,int,int) RETURNS int
+ AS 'MODULE_PATHNAME','dameraulevenshtein_less_equal_with_costs_noncompatible'
+ LANGUAGE C IMMUTABLE STRICT;


I updated:

https://github.com/liminghu/fuzzystrmatch/blob/fuzzystrmatchv1.1/fuzzystrmatch--1.0.sql

https://github.com/liminghu/fuzzystrmatch/blob/fuzzystrmatchv1.1/fuzzystrmatch--unpackaged--1.0.sql

correspondingly.

Sorry about that.

Thanks and nice day.

Liming


>
> - --
> Joe Conway
> credativ LLC: http://www.credativ.us
> Linux, PostgreSQL, and general Open Source
> Training, Service, Consulting, & 24x7 Support
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
> Comment: Using GnuPG with undefined - http://www.enigmail.net/
>
> iQIcBAEBAgAGBQJRyOw2AAoJEDfy90M199hlFhEP/2o/d08Fq4CHA9iI05PxDwQM
> AHF6PWS5gJToNLtiTevyEamWyzlULjX3yJ9gTAhxc+ltxE9Xuf3/bfMcJQSbJ5c9
> 6GSH7CWpaY1DpfAwvYiwTJ9EPBZ11u8VZaMrb1VU2DS8rioOOL3llzpk+D6/1no5
> y327vlH1aOuqk3Hwu0c/WN8RAcf1HLbhafph2KruUfr/ba3uILBQZtzpyK4uCDew
> OJA+cktXHv3ho7w4N//xVQs3sZ/EoLahOt/y4syd3dN+Cq/8kj/uJaVgT2QY8rDQ
> HIBpYvm+b3DsYpjw2qrSVBriIupF2a0UPkLfC5cu3om8VvBilShydE6uTI+f+55p
> a12NuzepwgDnpZ1jOZkkmnBslpfoZI9TEo1UDeZ8x/TSZDW72FhwRtWq9kO9CFIK
> cJvG9B9E5zhyZx9V1C2S0qpvIJAj/Gns4ymvYU1lm5UUnpPSpTQoUK8ybrfnHoTE
> B0DEVjqxbrk9SSJ5LI3KojAaSMUIQDcjMQFCsghR1s5/yRhpZ7xEPvcL63ARwDcv
> ZeeL6r5G+nmKAfRAjGbmWi/Y1ANI0ucO5XxnfhSDb+TCQow4U6IgNvkYjN1hTNEI
> //9mQHDHi5qsuGcRcgvFLLeR4eVSGewseYLOR9XELMYTam4IUClwPr6WHuMqE/aE
> jvMZafqZ/1EhQ2SeqCo4
> =wcGM
> -----END PGP SIGNATURE-----



--
Liming Hu
cell: (435)-512-4190
Seattle Washington



Re: request a new feature in fuzzystrmatch

From
Joe Conway
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/25/2013 01:37 PM, Liming Hu wrote:
>> please remove "dameraulevenshteinnocompatible" related stuff, I
>> just followed the template you created. 
>> "dameraulevenshteinnocompatible" was used in my first testing.

>> diff -cNr
>> /opt/src/pgsql-git/master/contrib/fuzzystrmatch/fuzzystrmatch--1.0.sql
>>
>> 
diff -cNr
/opt/src/pgsql-git/master/contrib/fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql

Actually, given that this change will create version 1.1 of the
extension, I believe the 1.0 versions of the sql scripts should
probably be removed entirely. Can someone with more knowledge of the
extension facility comment on that?

Joe


- -- 
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQIcBAEBAgAGBQJRz0V5AAoJEDfy90M199hl3sgP/Ai51I56A7luUhRFt2s3eo0p
HWiuxsWU2tXwoGmvYFtSze80mpfBfCGpBrD+uhh2PLZlFt6uS21wpYaezr1Y9wAM
astvWAOXVOg/AUlb5lyoAze5CL3kpRVX7EvUPGrzb6RMK3VfIckRdIoqwh8/Ko/C
j1ECEcWMHsRDUUDs+kU/mXAyRKpnC+VdSwOAU/k3J7Q0KpSvCZ4R+codinR29Ub4
L4W30436IKOr+BktorFc24FYRpVVG2llMPtWUhgKb1MfW5d+NRqID0gTIF4a9TJr
yaEBmmT1eupdje4pwY3R+xDGroCj3AAx7PAfW+CRMrsYvEFVy945l2lbSjvqDlDy
lpFsWWepYNdQhZBKP0Au986aqTKmoKgFoyWV/Yi7BfLx7Gh70Wk8OPcDKuUIdHou
UNfMouAUxGW9ZHZRmDSaYncTnLEcEJS11akddoIKDXCbdTVAQXFGLNqv1pp0KN+J
xU1eOrh+oQVwTayZH+S2Xa8+AT+g9wLH5zynJozDSRitdLIGdN1zzUVVXdO1Nx2i
2anxXdoW4DB+x+G8ea2Wmxfsw3MMS8Ck10VqhN6JMojDP0rczA6+EFrZcBlsWlWx
LX4iPTroUGZ318IC+A2CXci0uXs7+2l2zrescpEdqrqcTwTJHpGFbRbYniGBFgXW
6LeSPHhRDQUykXMvEU9I
=xeVQ
-----END PGP SIGNATURE-----



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On 6/29/2013 1:37 PM, Joe Conway wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 06/25/2013 01:37 PM, Liming Hu wrote:
>>> please remove "dameraulevenshteinnocompatible" related stuff, I
>>> just followed the template you created.
>>> "dameraulevenshteinnocompatible" was used in my first testing.
>>> diff -cNr
>>> /opt/src/pgsql-git/master/contrib/fuzzystrmatch/fuzzystrmatch--1.0.sql
>>>
>>>
> diff -cNr
> /opt/src/pgsql-git/master/contrib/fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql
>
> Actually, given that this change will create version 1.1 of the
> extension, I believe the 1.0 versions of the sql scripts should
> probably be removed entirely. Can someone with more knowledge of the
> extension facility comment on that?
>
> Joe
Thanks. It is my first contribution to Postgresql community.

LIming
>
> - -- 
> Joe Conway
> credativ LLC: http://www.credativ.us
> Linux, PostgreSQL, and general Open Source
> Training, Service, Consulting, & 24x7 Support
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
> Comment: Using GnuPG with undefined - http://www.enigmail.net/
>
> iQIcBAEBAgAGBQJRz0V5AAoJEDfy90M199hl3sgP/Ai51I56A7luUhRFt2s3eo0p
> HWiuxsWU2tXwoGmvYFtSze80mpfBfCGpBrD+uhh2PLZlFt6uS21wpYaezr1Y9wAM
> astvWAOXVOg/AUlb5lyoAze5CL3kpRVX7EvUPGrzb6RMK3VfIckRdIoqwh8/Ko/C
> j1ECEcWMHsRDUUDs+kU/mXAyRKpnC+VdSwOAU/k3J7Q0KpSvCZ4R+codinR29Ub4
> L4W30436IKOr+BktorFc24FYRpVVG2llMPtWUhgKb1MfW5d+NRqID0gTIF4a9TJr
> yaEBmmT1eupdje4pwY3R+xDGroCj3AAx7PAfW+CRMrsYvEFVy945l2lbSjvqDlDy
> lpFsWWepYNdQhZBKP0Au986aqTKmoKgFoyWV/Yi7BfLx7Gh70Wk8OPcDKuUIdHou
> UNfMouAUxGW9ZHZRmDSaYncTnLEcEJS11akddoIKDXCbdTVAQXFGLNqv1pp0KN+J
> xU1eOrh+oQVwTayZH+S2Xa8+AT+g9wLH5zynJozDSRitdLIGdN1zzUVVXdO1Nx2i
> 2anxXdoW4DB+x+G8ea2Wmxfsw3MMS8Ck10VqhN6JMojDP0rczA6+EFrZcBlsWlWx
> LX4iPTroUGZ318IC+A2CXci0uXs7+2l2zrescpEdqrqcTwTJHpGFbRbYniGBFgXW
> 6LeSPHhRDQUykXMvEU9I
> =xeVQ
> -----END PGP SIGNATURE-----




Re: request a new feature in fuzzystrmatch

From
Michael Paquier
Date:
On Sun, Jun 30, 2013 at 5:37 AM, Joe Conway <mail@joeconway.com> wrote:
> Actually, given that this change will create version 1.1 of the
> extension, I believe the 1.0 versions of the sql scripts should
> probably be removed entirely. Can someone with more knowledge of the
> extension facility comment on that?
When upgrading this extension here is what you should do:
- Remove fuzzystrmatch--1.0.sql
- Add fuzzystrmatch--1.1.sql with the new definitions
- Add fuzzystrmatch--1.0--1.1.sql to be able to perform an upgrade
between 1.0 and 1.1
- Let fuzzystrmatch--unpackaged--1.0.sql as-is

Then by having a quick glance at the patch you sent...
- fuzzystrmatch--unpackaged--1.0.sql is renamed internally to 1.1.sql
- fuzzystrmatch--1.0.sql remains, and is renamed to 1.1 internally
- fuzzystrmatch--1.0--1.1.sql is not provided

Regards,
--
Michael



Re: request a new feature in fuzzystrmatch

From
Alvaro Herrera
Date:
Joe Conway escribió:

> Actually, given that this change will create version 1.1 of the
> extension, I believe the 1.0 versions of the sql scripts should
> probably be removed entirely. Can someone with more knowledge of the
> extension facility comment on that?

Besides what Michael said, another thing is that you need to ensure that
if the functions are run with the 1.0 definitions, they don't crash
(i.e. you need to check the number of arguments actually passed to
function(s), and ensure no changes are made to the types of previously
existing arguments).  You can test this by installing the 1.0 version in
a 9.3 database, then pg_upgrade, and test the functions without running
the ALTER EXTENSION UPGRADE.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



Re: request a new feature in fuzzystrmatch

From
Josh Berkus
Date:
On 06/29/2013 01:37 PM, Joe Conway wrote:
> On 06/25/2013 01:37 PM, Liming Hu wrote:
>>> please remove "dameraulevenshteinnocompatible" related stuff, I
>>> just followed the template you created. 
>>> "dameraulevenshteinnocompatible" was used in my first testing.
> 
>>> diff -cNr
>>> /opt/src/pgsql-git/master/contrib/fuzzystrmatch/fuzzystrmatch--1.0.sql
>>>
>>>
> diff -cNr
> /opt/src/pgsql-git/master/contrib/fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql
> 
> Actually, given that this change will create version 1.1 of the
> extension, I believe the 1.0 versions of the sql scripts should
> probably be removed entirely. Can someone with more knowledge of the
> extension facility comment on that?

I believe that's correct.


-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On Sat, Jun 29, 2013 at 7:55 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Sun, Jun 30, 2013 at 5:37 AM, Joe Conway <mail@joeconway.com> wrote:
>> Actually, given that this change will create version 1.1 of the
>> extension, I believe the 1.0 versions of the sql scripts should
>> probably be removed entirely. Can someone with more knowledge of the
>> extension facility comment on that?
> When upgrading this extension here is what you should do:
> - Remove fuzzystrmatch--1.0.sql
> - Add fuzzystrmatch--1.1.sql with the new definitions
> - Add fuzzystrmatch--1.0--1.1.sql to be able to perform an upgrade
> between 1.0 and 1.1
> - Let fuzzystrmatch--unpackaged--1.0.sql as-is
>
Hi Michael,

Thanks. What should be included in  fuzzystrmatch--1.0--1.1.sql for the upgrade?
Liming

> Then by having a quick glance at the patch you sent...
> - fuzzystrmatch--unpackaged--1.0.sql is renamed internally to 1.1.sql
> - fuzzystrmatch--1.0.sql remains, and is renamed to 1.1 internally
> - fuzzystrmatch--1.0--1.1.sql is not provided
>
> Regards,
> --
> Michael



--
Liming Hu
cell: (435)-512-4190
Seattle Washington



Re: request a new feature in fuzzystrmatch

From
Liming Hu
Date:
On Mon, Jul 1, 2013 at 8:09 AM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> Joe Conway escribió:
>
>> Actually, given that this change will create version 1.1 of the
>> extension, I believe the 1.0 versions of the sql scripts should
>> probably be removed entirely. Can someone with more knowledge of the
>> extension facility comment on that?
>
> Besides what Michael said, another thing is that you need to ensure that
> if the functions are run with the 1.0 definitions, they don't crash
> (i.e. you need to check the number of arguments actually passed to
> function(s), and ensure no changes are made to the types of previously
> existing arguments).  You can test this by installing the 1.0 version in
> a 9.3 database, then pg_upgrade, and test the functions without running
> the ALTER EXTENSION UPGRADE.
>
> --
> Álvaro Herrera                http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
Hi Alvaro,

I do not have a 9.3 environment. I did not change any previous existing code.
Can anybody help me on the upgrade?

Thanks,

Liming


--
Liming Hu
cell: (435)-512-4190
Seattle Washington



Re: request a new feature in fuzzystrmatch

From
Alvaro Herrera
Date:
Liming Hu escribió:

> I do not have a 9.3 environment. I did not change any previous existing code.

git checkout REL9_3_STABLE

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



Re: request a new feature in fuzzystrmatch

From
Josh Berkus
Date:
Liming,

Given that this patch will not be ready for commit this week, but has
gotten a review, I am marking it as "Returned with Feedback".   Please
keep working on it, and as soon as you have a new version of the patch,
add it to the September commitfest.  Thanks!

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



Re: request a new feature in fuzzystrmatch

From
Alvaro Herrera
Date:
Josh Berkus escribió:
> Liming,
> 
> Given that this patch will not be ready for commit this week, but has
> gotten a review, I am marking it as "Returned with Feedback".   Please
> keep working on it, and as soon as you have a new version of the patch,
> add it to the September commitfest.  Thanks!

I don't think this patch has gotten any useful review actually.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



Re: request a new feature in fuzzystrmatch

From
Josh Berkus
Date:
On 07/03/2013 04:05 PM, Alvaro Herrera wrote:
> Josh Berkus escribió:
>> Liming,
>>
>> Given that this patch will not be ready for commit this week, but has
>> gotten a review, I am marking it as "Returned with Feedback".   Please
>> keep working on it, and as soon as you have a new version of the patch,
>> add it to the September commitfest.  Thanks!
>
> I don't think this patch has gotten any useful review actually.

Oh?  I thought it was at the state where Liming had to do a whole bunch
of changes before it could be reviewed further?

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



Re: request a new feature in fuzzystrmatch

From
Michael Paquier
Date:
On Thu, Jul 4, 2013 at 8:05 AM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> Josh Berkus escribió:
>> Liming,
>>
>> Given that this patch will not be ready for commit this week, but has
>> gotten a review, I am marking it as "Returned with Feedback".   Please
>> keep working on it, and as soon as you have a new version of the patch,
>> add it to the September commitfest.  Thanks!
>
> I don't think this patch has gotten any useful review actually.
Exactly. I didn't check the content of the patch, just looked quickly
at the changes done for the extension upgrade.
--
Michael



Re: request a new feature in fuzzystrmatch

From
Alvaro Herrera
Date:
Josh Berkus wrote:
> On 07/03/2013 04:05 PM, Alvaro Herrera wrote:
> > Josh Berkus escribió:
> >> Liming,
> >>
> >> Given that this patch will not be ready for commit this week, but has
> >> gotten a review, I am marking it as "Returned with Feedback".   Please
> >> keep working on it, and as soon as you have a new version of the patch,
> >> add it to the September commitfest.  Thanks!
> > 
> > I don't think this patch has gotten any useful review actually.
> 
> Oh?  I thought it was at the state where Liming had to do a whole bunch
> of changes before it could be reviewed further?

No, the comments have been solely on the details of the extension
definition files and the like.  There has been not a single comment
about the new algorithm being proposed, which is the interesting stuff
in this patch.  Review can certainly proceed without regard for the sql
files at all.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



Re: request a new feature in fuzzystrmatch

From
Michael Paquier
Date:
Hi Liming,

Here is a more formal review of this patch.

First, when submitting a patch, please follow the following guidelines:
http://wiki.postgresql.org/wiki/Submitting_a_Patch
http://wiki.postgresql.org/wiki/Creating_Clean_Patches

Particularly, when you develop a new feature, people will expect that
you submit your patches based on the master branch in git. This
extremely facilitates the review and test work that can be done based
on your work. So do not create a new dedicated project on github like
that => https://github.com/liminghu/fuzzystrmatch, but for example
fork the postgres repository, and work directly on it using for
example custom branches, then generate patches between your custom
branches and postgres master branch.

Also, new features need to be submitted to a commit fest
(https://commitfest.postgresql.org/). The next commit fest is in
September, so you have plenty of time to update your patch based on
the comments of my review (and perhaps comments of others), then
register a patch directly there when you are done.

In order to perform my review, I took your github project and
generated a diff patch. The patch is attached, and applies to master
branch, so you could use it for your future work as a base.

OK, now for the review, here are some comments about the structure of
the patch, which is incorrect based on the structure extensions need
to have.
1) This patch lacks documentation, you shouldn't add a README.md file.
So remove it and updated the dedicated sgml documentation. In your
case, the file to be updated with more details about
Damerau–Levenshtein is doc/src/sgml/fuzzystrmatch.sgml.
2) Remove fuzzystrmatch--1.0.sql, this is not necessary anymore
because this module is upgraded to 1.1
3) Remove fuzzystrmatch--unpackaged--1.1.sql, it is not needed
4) Add fuzzystrmatch--1.0--1.1.sql, which is a file that can be used
to upgrade an existing fuzzystrmatch 1.0 to 1.1. This needs to contain
all the modifications allowing to do a correct upgrade: alter existing
objects to their new shape, add new objects, and remove unnecessary
objects. In your case, this file should have this shape:
/* contrib/fuzzystrmatch/fuzzystrmatch--1.0--1.1.sql */

-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION fuzzystrmatch UPDATE" to load this file. \quit

CREATE FUNCTION damerau_levenstein()...
etc.
5) Your code copies a function from TOMOYO Linux, which is under GPL2
license, so I believe that this cannot be integrated to Postgres which
is under PostgreSQL license (more permissive). Just based on that some
portions of this code cannot be included in Postgres, I am not sure
but this gives a sufficient reason to reject this patch.

This is all I have about the shape of the patch...

Also, I am not (yet) very familiar with Damerau–Levenshtein itself and
I need to read more about that before giving a precise opinion... but
here are some comments anyway based on what I can read from the code:
1) There is a lot of duplicated code among levenshtein.c,
dameraulevenshtein.c and dameraulevenshtein_new.c, why is that?
levenshtein.c refers even to a variable called trans_c which is even
used nowehere.
2) By doing a simple diff between for example levenshtein.c and
dameraulevenshtein.c, the only new thing is the function called
dameraulevenshtein_internal_noncompatible copied from tomoyo linux...
And this function is used nowhere... The new functions for
Damerau–Levenshtein equivalent to levenshtein[_less_equal], called
damaraulevenshtein[_less_equal], are exactly the same things

So, in short, even if I may not be able to give a precise opinion
about Damerau–Levenshtein, what this patch tries to achieve is unclear
to me... The only new feature I can see is
dameraulevenshtein_internal_noncompatible but this is taken from code
licensed as GPL.
--
Michael

Attachment

Re: request a new feature in fuzzystrmatch

From
Robert Haas
Date:
On Thu, Jul 4, 2013 at 3:59 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> 5) Your code copies a function from TOMOYO Linux, which is under GPL2
> license, so I believe that this cannot be integrated to Postgres which
> is under PostgreSQL license (more permissive). Just based on that some
> portions of this code cannot be included in Postgres, I am not sure
> but this gives a sufficient reason to reject this patch.

We definitely cannot accept any GPL code into PostgreSQL.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company