Re: request a new feature in fuzzystrmatch

Lists: pgsql-hackerspgsql-www
From: Liming Hu <dawninghu(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: request a new feature in fuzzystrmatch
Date: 2013-05-17 00:41:24
Message-ID: CAE-MfPskWpxH9hWtNtY85gF76LZ7=k-V5DminnFWBfZwFxxdXA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Fwd: request a new feature in fuzzystrmatch
Date: 2013-05-17 00:47:33
Message-ID: CAE-MfPvni_GCxY7rS_f67fo=XJw4zKyOxXjkicdELk5b+jhWBQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

---------- Forwarded message ----------
From: Liming Hu <dawninghu(at)gmail(dot)com>
Date: Thu, May 16, 2013 at 5:41 PM
Subject: request a new feature in fuzzystrmatch
To: pgsql-hackers(at)postgresql(dot)org

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

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


From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: "dawninghu(at)gmail(dot)com" <dawninghu(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-17 10:00:59
Message-ID: 72C6BCB4-D4B5-4452-9AD9-D7110346A755@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

Sent from my iPad

On 17-May-2013, at 6:11, Liming Hu <dawninghu(at)gmail(dot)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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-17 15:21:11
Message-ID: 51964AE7.7080202@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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(at)gmail(dot)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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-17 15:23:13
Message-ID: 51964B61.6000408@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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(at)gmail(dot)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
>


From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Liming Hu <dawninghu(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-17 15:23:47
Message-ID: CAOeZVifPtHw2e79n9HHwx-B_X6UTpZTsoJb1W5mEtnc6K5fOsA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Fri, May 17, 2013 at 8:51 PM, Liming Hu <dawninghu(at)gmail(dot)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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-17 15:26:04
Message-ID: 51964C0C.1020406@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On 5/17/2013 8:23 AM, Atri Sharma wrote:
> On Fri, May 17, 2013 at 8:51 PM, Liming Hu <dawninghu(at)gmail(dot)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.


From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Liming Hu <dawninghu(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-17 15:29:49
Message-ID: CAOeZVievvrdJ2PM4Uf1vP9eViKcoZkT48B=VqVAC=t5UoN4_3Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Fri, May 17, 2013 at 8:56 PM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
> On 5/17/2013 8:23 AM, Atri Sharma wrote:
>>
>> On Fri, May 17, 2013 at 8:51 PM, Liming Hu <dawninghu(at)gmail(dot)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


From: Cédric Villemain <cedric(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>, Liming Hu <dawninghu(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-17 15:50:38
Message-ID: 201305171750.43107.cedric@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Liming Hu <dawninghu(at)gmail(dot)com>
Cc: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-17 15:59:54
Message-ID: 20130517155954.GP15045@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Liming Hu <dawninghu(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-17 16:10:32
Message-ID: CAOeZVicwuP6733x9jaiG5-a0_MYO2X7zyXH-6SQQ_6g90YEMXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Fri, May 17, 2013 at 9:29 PM, Alvaro Herrera
<alvherre(at)2ndquadrant(dot)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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-17 16:40:27
Message-ID: CAE-MfPumsY8fELsPOLU18=7vgQDgF6mm5aDTFoOHaCYKUTpsSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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(dot)jiit(at)gmail(dot)com> wrote:
> On Fri, May 17, 2013 at 9:29 PM, Alvaro Herrera
> <alvherre(at)2ndquadrant(dot)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


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-17 19:06:06
Message-ID: 51967F9E.1070100@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www


> 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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-17 19:39:22
Message-ID: CAE-MfPvFXN_nnJHgmfMZLxDjiZ8sv=Py9_XcyVzi2cB0iZZTbg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: dawninghu(at)gmail(dot)com
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 03:57:14
Message-ID: 5196FC1A.7060709@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On 5/17/2013 12:39 PM, Liming Hu wrote:
> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
sudo cp fuzzystrmatch.so
/usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
liming(at)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(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-hackers
>
>
> --
> Liming Hu
> cell: (435)-512-4190
> Seattle Washington


From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Liming Hu <dawninghu(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 04:10:02
Message-ID: CAOeZViccy0SgB_vDbhncUm0jrZPvM_b_yv5Z=yWjpWZCfXP9KQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>
>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
> sudo cp fuzzystrmatch.so
> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
> liming(at)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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 04:30:27
Message-ID: 519703E3.1090903@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On 5/17/2013 9:10 PM, Atri Sharma wrote:
> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>> sudo cp fuzzystrmatch.so
>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>> liming(at)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


From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Liming Hu <dawninghu(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 04:39:46
Message-ID: 48C0403F-D17E-4570-AE6F-380B5841E85C@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

Sent from my iPad

On 18-May-2013, at 10:00, Liming Hu <dawninghu(at)gmail(dot)com> wrote:

> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>> sudo cp fuzzystrmatch.so
>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>> liming(at)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.

Regards,

Atri
>


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 05:11:41
Message-ID: CAE-MfPuz8FPXaAQShi0J_qoGhAf=0f_BaOMvXMy4HPVC5gQE_A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>
>
> Sent from my iPad
>
> On 18-May-2013, at 10:00, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>
>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>> sudo cp fuzzystrmatch.so
>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>> liming(at)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
make install
?

>
> Regards,
>
> Atri
>>

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


From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: "dawninghu(at)gmail(dot)com" <dawninghu(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 05:21:08
Message-ID: 6729F5FE-7198-4DD8-94B7-5ECBFAEFEC4A@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

Sent from my iPad

On 18-May-2013, at 10:41, Liming Hu <dawninghu(at)gmail(dot)com> wrote:

> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 10:00, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>
>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>> sudo cp fuzzystrmatch.so
>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>>> liming(at)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(at)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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 05:53:24
Message-ID: CAE-MfPvM_sOF0O0Au22DuX+9zStuaFy0+_fYZkdf=vTGhuBkZQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>
>
> Sent from my iPad
>
> On 18-May-2013, at 10:41, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>
>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 10:00, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>
>>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>> sudo cp fuzzystrmatch.so
>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>>>> liming(at)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(at)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(at)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(at)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(at)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


From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: "dawninghu(at)gmail(dot)com" <dawninghu(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 06:13:00
Message-ID: EDEFEC2D-0E2F-47B2-A73F-710B14804C8B@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

Sent from my iPad

On 18-May-2013, at 11:23, Liming Hu <dawninghu(at)gmail(dot)com> wrote:

> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 10:41, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>
>>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>>
>>>>
>>>> Sent from my iPad
>>>>
>>>> On 18-May-2013, at 10:00, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>
>>>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>> sudo cp fuzzystrmatch.so
>>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>>>>> liming(at)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(at)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(at)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(at)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(at)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?

Regards,

Atri


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 06:37:12
Message-ID: CAE-MfPusWdCJ5a5_vn5M2xr_sc2ed2n6=E6oDLaRr5w8iSLS+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>
>
> Sent from my iPad
>
> On 18-May-2013, at 11:23, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>
>> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 10:41, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>
>>>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>>>
>>>>>
>>>>> Sent from my iPad
>>>>>
>>>>> On 18-May-2013, at 10:00, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>>
>>>>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>>>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>>> sudo cp fuzzystrmatch.so
>>>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>>>>>> liming(at)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(at)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(at)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(at)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(at)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(at)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(at)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(at)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


From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: "dawninghu(at)gmail(dot)com" <dawninghu(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 06:44:27
Message-ID: 02E04F8C-CB71-4D12-801F-ED2B5F2B0A69@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

Sent from my iPad

On 18-May-2013, at 12:07, Liming Hu <dawninghu(at)gmail(dot)com> wrote:

> On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 11:23, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>
>>> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>>
>>>>
>>>> Sent from my iPad
>>>>
>>>> On 18-May-2013, at 10:41, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>
>>>>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>>>>
>>>>>>
>>>>>> Sent from my iPad
>>>>>>
>>>>>> On 18-May-2013, at 10:00, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>>>
>>>>>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>>>>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>>>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>>>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>>>> sudo cp fuzzystrmatch.so
>>>>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>>>>>>> liming(at)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(at)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(at)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(at)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(at)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(at)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(at)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(at)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
>


From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: "dawninghu(at)gmail(dot)com" <dawninghu(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, PgHacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 07:11:03
Message-ID: 123A01ED-4073-4389-ACA4-E58AFCA0BABE@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

Sent from my iPad

On 18-May-2013, at 12:34, Liming Hu <dawninghu(at)gmail(dot)com> wrote:

> On Fri, May 17, 2013 at 11:44 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 12:07, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>
>>> On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>>
>>>>
>>>> Sent from my iPad
>>>>
>>>> On 18-May-2013, at 11:23, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>
>>>>> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>>>>
>>>>>>
>>>>>> Sent from my iPad
>>>>>>
>>>>>> On 18-May-2013, at 10:41, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>>>
>>>>>>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> Sent from my iPad
>>>>>>>>
>>>>>>>> On 18-May-2013, at 10:00, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>>>>>
>>>>>>>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>>>>>>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>>>>>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>>>>>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>>>>>> sudo cp fuzzystrmatch.so
>>>>>>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>>>>>>>>> liming(at)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(at)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(at)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(at)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(at)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(at)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(at)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(at)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?

Regards,

Atri
>


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, PgHacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 08:00:05
Message-ID: 51973505.1010209@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On 5/18/2013 12:11 AM, Atri Sharma wrote:
>
> Sent from my iPad
>
> On 18-May-2013, at 12:34, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>
>> On Fri, May 17, 2013 at 11:44 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 12:07, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>
>>>> On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>>>
>>>>> Sent from my iPad
>>>>>
>>>>> On 18-May-2013, at 11:23, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>>
>>>>>> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>>>>>
>>>>>>> Sent from my iPad
>>>>>>>
>>>>>>> On 18-May-2013, at 10:41, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>>>>
>>>>>>>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>>>>>>>
>>>>>>>>> Sent from my iPad
>>>>>>>>>
>>>>>>>>> On 18-May-2013, at 10:00, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>>>>>>
>>>>>>>>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>>>>>>>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>>>>>>>>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>>>>>>>>>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>>>>>>>>>>> sudo cp fuzzystrmatch.so
>>>>>>>>>>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>>>>>>>>>>> liming(at)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(at)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(at)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(at)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(at)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(at)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(at)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(at)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


From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Liming Hu <dawninghu(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, PgHacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 08:03:20
Message-ID: CAOeZVif94D4CeLVYe55AyxYbTsPKPus5NrkqV04gFQMT9548Bg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Sat, May 18, 2013 at 1:30 PM, Liming Hu <dawninghu(at)gmail(dot)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(at)gmail(dot)com> wrote:
>
> On Fri, May 17, 2013 at 11:44 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>
> Sent from my iPad
>
> On 18-May-2013, at 12:07, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>
> On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>
> Sent from my iPad
>
> On 18-May-2013, at 11:23, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>
> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>
> Sent from my iPad
>
> On 18-May-2013, at 10:41, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>
> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>
> Sent from my iPad
>
> On 18-May-2013, at 10:00, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>
> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>
> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>
> On 5/17/2013 12:39 PM, Liming Hu wrote:
>
> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
> sudo cp fuzzystrmatch.so
> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
> liming(at)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(at)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(at)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(at)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(at)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(at)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(at)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(at)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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, PgHacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 08:17:01
Message-ID: 519738FD.7000301@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On 5/18/2013 1:03 AM, Atri Sharma wrote:
> On Sat, May 18, 2013 at 1:30 PM, Liming Hu <dawninghu(at)gmail(dot)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(at)gmail(dot)com> wrote:
>>
>> On Fri, May 17, 2013 at 11:44 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 12:07, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>
>> On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 11:23, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>
>> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 10:41, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>
>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>
>> Sent from my iPad
>>
>> On 18-May-2013, at 10:00, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>
>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>
>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>
>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>
>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>> sudo cp fuzzystrmatch.so
>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>> liming(at)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(at)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(at)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(at)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(at)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(at)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(at)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(at)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.


From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Liming Hu <dawninghu(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, PgHacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-18 08:20:53
Message-ID: CAOeZVidiKsfEZDFgaPq4htaG8w1RxL5vm2jiDn++Y-9kK1Bc7A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Sat, May 18, 2013 at 1:47 PM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
> On 5/18/2013 1:03 AM, Atri Sharma wrote:
>>
>> On Sat, May 18, 2013 at 1:30 PM, Liming Hu <dawninghu(at)gmail(dot)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(at)gmail(dot)com> wrote:
>>>
>>> On Fri, May 17, 2013 at 11:44 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
>>> wrote:
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 12:07, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>
>>> On Fri, May 17, 2013 at 11:13 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
>>> wrote:
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 11:23, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>
>>> On Fri, May 17, 2013 at 10:21 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
>>> wrote:
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 10:41, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>
>>> On Fri, May 17, 2013 at 9:39 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>>>
>>> Sent from my iPad
>>>
>>> On 18-May-2013, at 10:00, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>
>>> On 5/17/2013 9:10 PM, Atri Sharma wrote:
>>>
>>> On Sat, May 18, 2013 at 9:27 AM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
>>>
>>> On 5/17/2013 12:39 PM, Liming Hu wrote:
>>>
>>> On Fri, May 17, 2013 at 12:06 PM, Josh Berkus <josh(at)agliodbs(dot)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(at)liming-UX31A:~/Downloads/postgresql-9.1.9/contrib/fuzzystrmatch$
>>> sudo cp fuzzystrmatch.so
>>> /usr/lib/postgresql/9.1/lib/fuzzystrmatch.so
>>> liming(at)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(at)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(at)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(at)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(at)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(at)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(at)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(at)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


From: David Fetter <david(at)fetter(dot)org>
To: Cédric Villemain <cedric(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>, Liming Hu <dawninghu(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-05-19 01:38:40
Message-ID: 20130519013840.GA4388@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-11 18:57:12
Message-ID: CAE-MfPvjSn2oFvXfKtno-VX2aQ13dFP9nTDf0y5G-uZpniiZKw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Sat, May 18, 2013 at 6:38 PM, David Fetter <david(at)fetter(dot)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(at)fetter(dot)org> http://fetter.org/
> Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
> Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)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


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Liming Hu <dawninghu(at)gmail(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-11 20:57:26
Message-ID: 20130611205726.GC5491@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-11 21:23:26
Message-ID: CAE-MfPsJ_ww+y_y9PN7Dzrg9STK0ckpmMUjL3DfsPE2C_PHNdg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Tue, Jun 11, 2013 at 1:57 PM, Alvaro Herrera
<alvherre(at)2ndquadrant(dot)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


From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: "dawninghu(at)gmail(dot)com" <dawninghu(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-11 21:56:01
Message-ID: 1370987761.64377.YahooMailNeo@web162902.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

Liming Hu <dawninghu(at)gmail(dot)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


From: Joe Conway <mail(at)joeconway(dot)com>
To: dawninghu(at)gmail(dot)com
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-11 21:56:56
Message-ID: 51B79D28.3010700@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

-----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(at)2ndquadrant(dot)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-----


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-11 22:19:45
Message-ID: CAE-MfPuGVnvexOM+iSjT_zc2t3H5z8FnPvr3qCdpEt1dP7WUHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Tue, Jun 11, 2013 at 2:56 PM, Joe Conway <mail(at)joeconway(dot)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(at)2ndquadrant(dot)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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-14 17:08:24
Message-ID: CAE-MfPuBEiMMjacLA6LGDy2j+tCR0dGo4MWgKJm_09AfsmdFVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Tue, Jun 11, 2013 at 3:19 PM, Liming Hu <dawninghu(at)gmail(dot)com> wrote:
> On Tue, Jun 11, 2013 at 2:56 PM, Joe Conway <mail(at)joeconway(dot)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(at)2ndquadrant(dot)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


From: David Fetter <david(at)fetter(dot)org>
To: Liming Hu <dawninghu(at)gmail(dot)com>
Cc: Joe Conway <mail(at)joeconway(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-14 17:11:39
Message-ID: 20130614171139.GJ2405@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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(at)gmail(dot)com> wrote:
> > On Tue, Jun 11, 2013 at 2:56 PM, Joe Conway <mail(at)joeconway(dot)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(at)2ndquadrant(dot)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(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)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


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Liming Hu <dawninghu(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-14 17:14:14
Message-ID: 51BB4F66.7080409@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www


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


From: David Fetter <david(at)fetter(dot)org>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Liming Hu <dawninghu(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-14 17:17:04
Message-ID: 20130614171704.GK2405@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)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


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-15 16:07:18
Message-ID: 51BC9136.4030001@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Liming Hu <dawninghu(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-16 04:51:11
Message-ID: 51BD443F.5080709@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-16 05:05:57
Message-ID: 51BD47B5.5080500@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: pgsql-www(at)postgresql(dot)org
Subject: Making submitting a patch FAQ (was Re: [HACKERS] request a new feature in fuzzystrmatch)
Date: 2013-06-16 13:10:42
Message-ID: 51BDB952.5070906@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www


On 06/14/2013 10:17 AM, David Fetter wrote:

>>
>> 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.

Probably. I just tried to objectively review what it would take to
submit a patch. It is a little spaghetti. From the website I click
developers->coding. That seems straight forward enough. The developers
FAQ is the 7th link down after flooding me with information on the
source code. So the first suggestion would be to push the FAQ to the
very first link. That is a relatively simple fix.

However, then it gets messy. Basically, I think we are too thorough. If
I want to submit a simple patch to fix error strings, I certainly don't
need everything that is presented in our developers faq. I need:

1. Where do I get a git checkout (forget this download the source from
ftp, that I think is inviting problems.)

2. Exactly what do I need to do to submit a patch.

That is all. In order to get that information I have to wade through a
whole lot more information that isn't immediately useful or interesting.

So something like, submitting a patch in 10 steps.

Sincerely,

JD

>
> Cheers,
> David.
>


From: Joe Conway <mail(at)joeconway(dot)com>
To: dawninghu(at)gmail(dot)com
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-25 01:02:53
Message-ID: 51C8EC3D.6020002@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

-----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 Content-Type Size
Levenshtein-Damerau.diff text/x-patch 22.8 KB

From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-25 17:37:52
Message-ID: CAE-MfPt2eL9GeOtYdO5RCKuJ__XcXg6BC4qEsRBtQwK4NXJSvA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Mon, Jun 24, 2013 at 6:02 PM, Joe Conway <mail(at)joeconway(dot)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


From: Joe Conway <mail(at)joeconway(dot)com>
To: dawninghu(at)gmail(dot)com
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-29 20:37:13
Message-ID: 51CF4579.10002@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

-----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-----


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-29 21:17:12
Message-ID: 51CF4ED8.8010505@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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-----


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: dawninghu(at)gmail(dot)com, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-06-30 02:55:16
Message-ID: CAB7nPqSfPyVYuRjKQ=YXg_FMW6DVjtjFOSBwMv-8c8FvG1Z+6g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Sun, Jun 30, 2013 at 5:37 AM, Joe Conway <mail(at)joeconway(dot)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


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: dawninghu(at)gmail(dot)com, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-07-01 15:09:32
Message-ID: 20130701150932.GC3757@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-07-03 21:25:09
Message-ID: 51D496B5.4050300@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Joe Conway <mail(at)joeconway(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-07-03 22:23:53
Message-ID: CAE-MfPtwKVjz6hW4TQVJ2o545X75NK1Kna4vf9qgkN3uGEEDrQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Sat, Jun 29, 2013 at 7:55 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> On Sun, Jun 30, 2013 at 5:37 AM, Joe Conway <mail(at)joeconway(dot)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


From: Liming Hu <dawninghu(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Joe Conway <mail(at)joeconway(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-07-03 22:25:32
Message-ID: CAE-MfPtU1fDK6Qi9mb+gmJFTueHVEVwoUjKov9Ya5zHQ+jnBuw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Mon, Jul 1, 2013 at 8:09 AM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)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


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Liming Hu <dawninghu(at)gmail(dot)com>
Cc: Joe Conway <mail(at)joeconway(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-07-03 22:32:41
Message-ID: 20130703223241.GI3592@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: dawninghu(at)gmail(dot)com
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Joe Conway <mail(at)joeconway(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-07-03 22:59:17
Message-ID: 51D4ACC5.4080204@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: dawninghu(at)gmail(dot)com, Joe Conway <mail(at)joeconway(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-07-03 23:05:09
Message-ID: 20130703230509.GJ3592@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-07-03 23:17:16
Message-ID: 51D4B0FC.8030905@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, dawninghu(at)gmail(dot)com, Joe Conway <mail(at)joeconway(dot)com>, David Fetter <david(at)fetter(dot)org>, Cédric Villemain <cedric(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-07-04 00:32:06
Message-ID: CAB7nPqQ-DJvnTWw1v1O-bMP6HxKa4S9Wd0frJP7RAj92SN6KSw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Thu, Jul 4, 2013 at 8:05 AM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)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


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-07-04 02:38:34
Message-ID: 20130704023834.GK3592@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: dawninghu(at)gmail(dot)com
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-07-04 07:59:24
Message-ID: CAB7nPqRatR2oqe6OpubvVyHnKgxLt2CbF4V5Hf3phPavgEcx7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

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 Content-Type Size
20130704_damerau_levenstein.patch application/octet-stream 35.5 KB

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: dawninghu(at)gmail(dot)com, Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: request a new feature in fuzzystrmatch
Date: 2013-07-04 15:51:37
Message-ID: CA+TgmobqidsrhP19=aHfrFCZoATdSn8gMTRh1rJNNqTShSJN7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-www

On Thu, Jul 4, 2013 at 3:59 AM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)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