| From: | carter ck <carterck32(at)hotmail(dot)com> | 
|---|---|
| To: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> | 
| Subject: | |
| Date: | 2007-10-31 03:07:36 | 
| Message-ID: | BAY101-W1511B7A0AA605D61D8630BD5930@phx.gbl | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
Hi all,
I was trying to create function in postgres, but it returns error mentioning the language is NOT defined.
The function is as following:
CREATE OR REPLACE FUNCTION test_word_count(TEXT, TEXT) RETURNS INTEGER AS $$
DECLARE
 d_word ALIAS FOR $1;
 d_phrase ALIAS FOR $2;
BEGIN
 IF d_word IS NULL OR d_phrase IS NULL THEN RETURN 0;
RETURN 1;
END;
$$ LANGUAGE plpgsql;
ERROR:  language "plpgsql" does not exist
HINT:  Use CREATE LANGUAGE to load the language into the database.
I was wonderring why it is not included by default? Or have I missed out something in the configuration!
Also, how to do a better text search? I have come across the bad performance of LIKE statement.
All helps are appreciated.
Thanks.
_________________________________________________________________
Manage multiple email accounts with Windows Live Mail!
http://www.get.live.com/wl/all
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ron St-Pierre | 2007-10-31 04:50:13 | Re: | 
| Previous Message | David Fetter | 2007-10-31 02:43:47 | Re: Delete/Update with order by |