How to load Additional Supplied Modules for Postgres on Windows

I try to enable "fuzzystrmatch" function in Postgresql 8.3.9, following is my solution:

  1. DO NOT install Postgresql under the default "Progrem File" directory, because the it can't not recognize the white space inside the path! I switch to some directory not containing while space, like "C:/PostgreSQL/8.3/". I will use this as my Postgres home directory. I install and reinstall several times and figure out this isssue. Actually. it is a very common problem using software ported form Linux world.
  2. You will find lots of DLL files under "lib". But we should go to "share/contrib" directory. Run:
    • C:/PostgreSQL/8.3/bin>psql -d postgres -U postgres -f C:/PostgreSQL/8.3/share/contrib/fuzzystrmatch.sql
      SET
      CREATE FUNCTION
      CREATE FUNCTION
      CREATE FUNCTION
      CREATE FUNCTION
      CREATE FUNCTION
      CREATE FUNCTION
      CREATE FUNCTION
  3. You should note that this funtion must be specified to any database you want. It is not a global setting! Then try SELECT levenshtein('GUMBO', 'GAMBOL'); or SELECT name FROM element  WHERE difference(name, 'item') > 2;
  4. If you want to check out more fuzzy search, go to reference [1]. There will be another solution, please refer to [2].
  5. Next, I will try xml and full-text search functions.

Reference:

[1]http://www.postgresql.org/docs/8.3/static/fuzzystrmatch.html

[2]http://stackoverflow.com/questions/430123/how-do-i-enable-the-postgresql-function-profiler

[3] FAQ on installation for Windows: http://wiki.postgresql.org/wiki/Running_&_Installing_PostgreSQL_On_Native_Windows

[4] Thanks this page poniting out the right location for the sql file: http://dcmms.sourceforge.net/doc/administration/index.html#fuzzystrmatch_manual_install

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值